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.

General Questions /

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

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

Retrieving Entire Page Child Page Content


Reply


447 Views

Avatar
yas

Community Member, 1 Post

5 July 2012 at 8:43pm

I have been working with silver stripe now and have found it easy to implement a hierarchical page structure with parent pages pulling content from their respective child pages.

I have however now come across a problem, when wanting to pull the entire child page content into a parent page.

I have the following structure
-All Distributors
- City Distributors
- Individual Distributors

The Individual Distributors are collected on the City Distributors page, and what I am trying to achieve is to Add All City Distributors to the All Distributors page.

The City Distributors page thus doesnt have any actual content, and its just a collection of content from child pages, I want to be able to pull the entire page content as is from the page and add it onto the parent page.

I have been searching the forum, but have not found anything quite as specific, any help would be greatly appreciated, or maybe just a pointer int the right direction.

Ideally what I would want to do is to have the following control in the Top Parent (All Distributors) page

<% control Children %>
<li>$Children.Content</li>
<% end_control %>

I cant use the $Content Variable to acheive this as the Child pages do not have any actual content? is there another way around this?