Jump to:

23479 Posts in 18951 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Getting staged version of page data and core system hooks

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 531 Views
  • tallrobphilp
    Avatar
    Community Member
    9 Posts

    Getting staged version of page data and core system hooks Link to this post

    I'm in the process oftrying to adapt silverstripe slightly, in that I wish to use the CMS backe-end "as-is" but basically do the page data fetch and display (templating) myself using a 3rd party template engine and give myself some extra flexibility.

    Basically I can see how to grab a SiteTree object with the SiteTree::get_by_link() method but I want to know what the equivalent call would be in order to grab the staged data for a given SiteTree object when I have the request object as passed into a controller action.

    Can anyone offer any advice?

    On the same subject - I have generally wondered if it is possible to "hook" into the SilverStripe core so that I can extend it more easily. At the minute I have found a fairly simple but slightly roundabout way of using a 3rd party template engine (twig from the devs of symfony framework) but it's a bit rough. Sopme hooks into the core would be valuable, but I can't see how to do this at present.

    Thanks.

  • Willr
    Avatar
    Forum Moderator
    5502 Posts

    Re: Getting staged version of page data and core system hooks Link to this post

    Take a look at the versions class. Lots of helper instance and static methods in that extension which allow you to get_by_stage() etc.

    http://api.silverstripe.org/2.4/sapphire/model/Versioned.html

    531 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.