I solved this by adding the following 'RecentNews' function into my code/page.php file
class Page extends SiteTree
{
private static $db = array();
private static $has_one = array();
}
class Page_Controller extends ContentController
{
private static $allowed_actions = array(
'RecentNews'
);
public function init()
{
parent::init();
}
function HomePage()
{
return HomePage::get()->limit(1)->first();
}
function ContactPage()
{
return ContactPage::get()->limit(1)->first();
}
public function RecentNews()
{
return BlogPost::get()
->sort('PublishDate', 'DESC')
->limit(5);
}
}
Then called it with the following in the BlogSideBar.ss file
<div class='blog-sidebar typography unit size1of4 lastUnit'>
<h3>Recent News</h3>
<% if $RecentNews %>
<% loop $RecentNews %>
<div class='archived-article'>
<p class='date-cat'>
DATE $PublishDate.format('d.m.Y') /
<span class="cat-name">
<% if $Categories %>
<% loop $Categories %>
$Title
<% end_loop %>
<% end_if %>
</span>
</p>
<h4>$Title</h4>
<% if $Summary %>
<p>$Summary</p>
<% else %>
<p>$Excerpt.FirstSentence</p>
<% end_if %>
<a href='$Link' class='read-more'>
Read More
</a>
</div>
<% end_loop %>
<% else %>
<p>No recent articles.</p>
<% end_if %>
</div>
With that you will be able to put recent blog posts on any page on your site.
Hope this helps someone out.
Cheers
TobyC