I'm building off the tutorial, and have added a flag system to the articles in article pages. This works with a simple dropdown box is either flagged or not flagged. Now on the Article Holder page i only want to show articles that are not flagged. Would I do this similar to how latest news is shown on the homepage?
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.
Yup, something similar to the below function
function showNonFlagged() {
return DataObject::get("Page", "flagged = no"); //change to suit how you set it up.
}
Then use the custom control in your template to loop through them all.
<% control showNonFlagged %>
yada yada yada
<% end_control %>