Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Deprecate and remove ContentController::ChildrenOf() / ::Page($link) #1042

axyr opened this Issue · 1 comment

2 participants


I sometimes see developers relying on getting pages in templates by URLSegment or ID that can be changed by endusers in the CMS.

This often happens when devs want to categorise pages and get the children of a particular page.

I think this should be solved by either creating a custom PageType that can only exist once and get Children by MyCustomPageType::get->First()->Children(), or create a DataObject to assign a Page to 1 or more categories.

I really can't think of a use case where creating a Page or Controller method to get a DataList or ArrayList with Pages by ClassName or by has_one/many_many DataObject is not better then getting Pages by URLSegment or ID in a template..


In this case you should just add a method to your controller which handles the logic behind fetching the correct page. This removes the need to have url segments and IDs hard-coded in your templates (or anywhere) and can also provide a graceful fallback when something unexpected happens.

I think this issue is project-specific and adding a new page type to core is just creating clutter for most end users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.