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

List of child pages in alphabetical order


Go to End


9 Posts   6696 Views

Avatar
martimiz

Forum Moderator, 1391 Posts

6 January 2015 at 12:26am

You could use a boolean db field 'ShowLinkOnPage' on your Page class, then create a CMS CheckboxField for it, and finaly create a function like this on your Page_Controller:

public function LinkOnPageChildren() {
    return $this->Children()->filter(array('ShowLinkOnPage' => true));
}

and use <% loop $LinkOnPageChildren %> in your template.

Or just use <% loop $Children %><% if ShowLinkOnPage %>... (Whichever you feel best)

Go to Top