3373 Posts in 998 Topics by 712 members
|Go to End|
5 January 2013 at 4:38am Last edited: 5 January 2013 7:49am
I'm trying to figure out how to create an editable field that holds a Site-wide message ex: "Welcome to our site" that displays on every page. I want to be able to edit the field in one place and update every page with the new message without changing any code after it's working. Even if I stuck that field on some random page, I still don't know how to access the fields of one page from a different page, especially if the pages are not direct siblings or descendants. The kind of information I would need to build a menu would probably be useful to find out how to build this site-wide message.
Can someone point me in the right direction?
Edit: I've discoverd Menu(1), Children and ChildrenOf() controls
Is there a page that lists all the default controls/functions that can be used in a template?
8 January 2013 at 4:32pm
There was a page for 2.4, but so far it hasn't been updated for 3. Most should still work though. http://doc.silverstripe.com/framework/en/2.4/reference/built-in-page-controls
As for site wide stuff, I usually use a custom site config. By default I always add the basic contact info there as wells as a default email for form submissions. In the the template it can be accessed from $SiteConfig.YourProperty
|Go to Top|