Scott Posted March 27, 2012 Share Posted March 27, 2012 hi guys. just starting out using PW and loving it so far. incredible work, Ryan! i haven't used CMSs too much in the past, but tried out enough and researched enough to know that PW is awesome and just makes simple sense in so many ways. i've been reading a lot about PW, but i can't seem to find any example of the best practice for creating global "shared" content, like for example, a footer with contact info to be the same across all pages. i have 1 idea, but not sure if it's the preferred method - i want to start out using the right method. should i do this, or something else? create a "footer" template and page, make the page status Hidden so it doesn't show up in navs, etc, and pull content from it to all pages using something like: $footer = $pages->get("/footer"); echo $footer->body; // or maybe better yet (i'm just starting out, i think this is the shorthand): echo $pages->get("/footer")->body; or am i missing a key concept of how to do this a different way? and, on a related note: would i do something similar if i wanted to have a "settings" page where the user would fill in things like their Facebook page URL, Twitter name, etc.? then wherever i had a Facebook logo to link to FB or a Twitter logo to link to Twitter, i'd pull in that field from the "settings" page like this? echo $pages->get("/settings")->twitter_name; your help is very much appreciated. thank you! 1 Link to comment Share on other sites More sharing options...
diogo Posted March 27, 2012 Share Posted March 27, 2012 Hi Scott! Welcome to the forum! There isn't really a right way. One of the good things about PW is that it lets you create your own way of doing things. With that said, I think you are on the right track. You can create a settings page, with a settings template, and do exactly as you showed on your template file. The best way would be creating the "settings" template without creating a template file, since you will output the content through other files. For the footer, you can also do like you said, but I would keep it more semantic, like - instead of calling it footer, I would call it contacts, and copyright, and people... you get it 1 Link to comment Share on other sites More sharing options...
ryan Posted March 28, 2012 Share Posted March 28, 2012 Welcome to the forums Scott! You are definitely on the right track. I do the same things that you mentioned. I also sometimes use the homepage template for holding fields that will be used site-wide. Link to comment Share on other sites More sharing options...
Scott Posted March 28, 2012 Author Share Posted March 28, 2012 great, thanks diogo and ryan! i'll try out those methods and see which ones feels right for my site. thanks! Link to comment Share on other sites More sharing options...
Alpine418 Posted May 22, 2019 Share Posted May 22, 2019 Is this still the best approach to handle site-wide custom settings without any modules? Edit: Oh, I see this thread is older than my two daughters ? Sorry for that. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now