Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Data Model Questions

Site-wide message


Reply

2 Posts   350 Views

Avatar
SilverStripeBill

5 January 2013 at 4:38am (Last edited: 5 January 2013 7:49am), Community Member, 3 Posts

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
http://www.silverstripe.org/template-questions/show/9008

Is there a page that lists all the default controls/functions that can be used in a template?

Avatar
zenmonkey

8 January 2013 at 4:32pm Community Member, 528 Posts

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