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.

General Questions /

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

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

SS3 : how to find isPublished


Go to End


1293 Views

Avatar
rsouthgate

Community Member, 12 Posts

22 September 2012 at 10:35pm

I'm trying to update some old SS2.4 code to work on SS3... Used to have this query... $publishedProfilePages = DataObject::get('ProfilePage', "\"Status\" = \"Published\");

In SS 3 there is no Status Column on the SiteTree table... in fact looking at the code it seems the isPublished method of SiteTree instead queries the SiteTree_Live table.

But I can't figure out how to use the DataList::create('ProfilePage') to look only in the SiteTree_Live table. Anyone know?

Thanks
Robin