Hi guys,
I've spent the day playing with SilverStripe and have fallen in love with the CMS and will be using it for pretty much all the sites I work on in future.
However I've hit a bit of a stumbling block with my first Silverstripe site, I am trying to get two blog posts shown on the homepage as in this image: http://img527.imageshack.us/img527/4167/43445519.jpg
I've managed to get blog posts to the homepage using code courtesy of Fuzz10:
HomePage.php:
function MyBlogEntries($limit = 1) {
$BlogEntries = DataObject::get_one("BlogHolder");
return ($BlogEntries) ? DataObject::get("BlogEntry", "ParentID = $BlogEntries->ID", "Date DESC", "", $limit) : false;
}
and
HomePage.ss:
<% control MyBlogEntries %> { ... } <% end_control%>
In WordPress I would simply use two separate "wp_loop" statements, one for the latest and one for the second newest posts. Is there a way of doing the same here? The CSS side of things is already done so I am just stumped with the SilverStripe template code.
Thanks for your help guys, very much appreciated,
Stewart