Hi to all, how can i display the whole content (all whats inside my page type: data objects, html tags, etc) of a page within another page? If that would exist, that is what id need: <% control Page(my-page) %>$all_content<% end_control %> - Thanks!
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.
Create a function in your Page_Controller that gets the page and returns it. eg:
//Page controller - you would need to specify an appropriate query to get whatever page you are after
public function MyPage(){
$page = Page::get()->First();
return $page;
}
//template for SS 3+ If function returns one page use 'with', if function returns more than one page use 'loop'
<% if MyPage %>
<% with MyPage %>
$Title
$Content
//if the page had a has_many relationship to another dataobject (eg GalleryImages) you can use that within
<% if GalleryImages %>
<% loop GalleryImages %>
$Image
<% end_loop %>
<% end_if %>
<% end_with %>
<% end_if %>