Hi all
I'm trying to create a list of the latest blog articles from the many Blog Holders on my site. At present I only get the articles from one of the Blogs. Can anyone help please???
My code so far is:
...Homepage.php......................................................
function LatestNews($num=5) {
$news = DataObject::get_one("BlogHolder");
return ($news) ? DataObject::get("BlogEntry", "ParentID = $news->ID", "Date DESC", "", $num) : false;
}
...Homepage.ss.........................................................
<ul id="NewsList">
<% control LatestNews %>
<h6 class="newsDateTitle"><a href="$Link" title="Read more on "{$Title}"">$Title</a></h6>
<ul class="newsDateTitle">$Date.Nice</ul>
<ul class="newsSummary">$Content.FirstParagraph<a href="$Link" title="Read more on "{$Title}"">Read more >></a></ul>
<% end_control %>
</ul>
Thanks in advance.
G