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.

Template Questions

Displaying Draft Content in Control Loop in Template


Reply

2 Posts   106 Views

Avatar
Zaid

15 August 2014 at 3:27pm Community Member, 1 Post

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

15 August 2014 at 4:50pm (Last edited: 15 August 2014 4:50pm), Community Member, 42 Posts

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

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