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.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Template Questions /

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

Displaying Draft Content in Control Loop in Template


Go to End


2 Posts   1008 Views

Avatar
Zaid

Community Member, 2 Posts

15 August 2014 at 3:27pm

I have a control in my SS template (<% control HomePageFeature %>), it works fine in returning HomePageFeature's that are published. However, when I make a change for example to the title of one of the home page features and when it goes into draft mode it no longer shows up when I preview the site (i.e. http://somesite.dev/?stage=Stage) which is accessed from the "Draft Site" link in the CMS backend.

Any idea on how I can let my control loop to display changes that are in draft so that the content editor can preview how it will look like prior to a "Save and Publish". Again if those features are published everything works fine.

Avatar
Kirk

Community Member, 67 Posts

15 August 2014 at 4:50pm

Edited: 15/08/2014 4:50pm

Is the HomePageFeature a DataObject as you may have to add versioning to that DataObject.
The links below give some advise on this

http://stackoverflow.com/questions/14992605/how-to-use-silverstripes-versioned-feature-for-dataobjects
http://doc.silverstripe.org/framework/en/topics/versioning