Jump to:

5450 Posts in 1672 Topics by 1197 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Is there an elegant way to make site-wide static content manageable?

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 977 Views
  • SilverRay
    Avatar
    Community Member
    167 Posts

    Is there an elegant way to make site-wide static content manageable? Link to this post

    Hi there again,

    In many sites, there's content that is sort of static, but sometimes needs to be updated. You know, things like headers above lists of links that are the same on every page, footers, etc. I can use includes to make them editable in one place, but that would not really be easily accessible to a site author (the user of the CMS I mean). I'm looking to find a way to make these things appear in the CMS. I was thinking of setting up "secret" pages to manage these things, or perhaps use a dataobject and a many_many relationship, just with one long row of name-value pairs, but for things that perhaps change a few times a year, it seems overkill to use control blocks (and hence more db calls every time) on every page just to show almost static information. Any thoughts?

    Thanks!

  • Fuzz10
    Avatar
    Community Member
    786 Posts

    Re: Is there an elegant way to make site-wide static content manageable? Link to this post

    I usually add a new tab in the UI for the homepage and stick all the configurable stuff under there.

  • UncleCheese
    Avatar
    4085 Posts

    Re: Is there an elegant way to make site-wide static content manageable? Link to this post

    This is a really interesting point. I think the only way you could really do it is to make those values properties of the home page, and when you want to get that nav header, for instance, you could just do a singleton('HomePage')-NavHeader call.

    If you want different values on every page, then I think a tablefield is the way to go. A type dropdown in one column and a value in the other e.g. Contact-Us || NavHeader here

    The most logical answer is to use static vars, of course, but your authors don't have access to PHP.

  • SilverRay
    Avatar
    Community Member
    167 Posts

    Re: Is there an elegant way to make site-wide static content manageable? Link to this post

    Yeah, I was thinking about the home page option too. The table option is of course useable for different headers on every page, but I want the same... Btw, as a related subject, the headers I'm talking about are headers for list of links in the footer (you see this often nowadays in sites). The links themselves are also the same on every page, and I do that with something loosely based on this:

    http://doc.silverstripe.com/doku.php?id=recipes:page_selection_for_special_menu

    (I thought maybe that helps someone.)

    Thanks for your thoughts!

    977 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.