Hello I have a site with multiple blogs on it.
The site is for a sports club and each sport has its own page (page.ss). These pages have children on Calenders, Blogs and other pages.
On the sport page I would like to display a feed of their specific blog.
I have managed to display a widget for there specific widget using the following code.
Page.php
public function GetChildren($Limit = 1){
$Children = $this->Children();
return $Children->limit($Limit, 0);
}
public function CalendarWidget() {
return Calendar::get()->first()->CalendarWidget();
}
Page.ss
<% control Children %>
<% control $GetChildren %>
$CalendarWidget
<% end_control %>
<% end_control %>
I was wondering if there is a way of displaying the blog feed for just the children.
I was thinking something along the lines of the following: (error code btw)
Page.php
public function LatestBlogEntry($num=4) {
$Children = $this->Children();
$blogpost = $Children::get_one("BlogHolder");
return ($blogpost) ? DataObject::get("BlogEntry", "", "Date DESC", "", $num) : false;
}
Has anyone done something similar before?