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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Template Questions /

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

Displaying Draft Content in Control Loop in Template


Go to End


2 Posts   1909 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