Hi sam,
In default template the sidebar display the sub menu of each page. Which is used as the controller menu
<% control Menu(1) %>
<% if Children %>
<% end_if %>
<% end_control %>
so it is fetching the rrs entry at there.
I have prepared the new code to display the rss entry as per my requirement which is same as you want. So I think it is useful to you too.
Step 1 : Copy the below code and paste in /spphire/core/control/ContentController.php
public function getRSSAggregating() {
$result = DataObject::get("SiteTree", "ParentID = 0 AND ClassName='RSSAggregatingPage'");
$visible = array();
// Remove all entries the can not be viewed by the current user
// We might need to create a show in menu permission
if(isset($result)) {
foreach($result as $page) {
if($page->can('view')) {
$page->SubAggregat = $this->getRSSAggregatingchild($page->ID);
$visible[] = $page;
}
}
}
return new DataObjectSet($visible);
}
public function getRSSAggregatingchild($page_id)
{
$result_sub = DataObject::get("RSSAggEntry", "PageID = ".$page_id." AND Displayed = 1", "Date ASC");
$visible_sub = array();
if($result_sub) {
foreach($result_sub as $page_sub) {
//if($page_sub->can('view')) {
$visible_sub[] = $page_sub;
//}
}
}
return new DataObjectSet($visible_sub);
//return $visible_sub;
}
public function RSSAggregating() {
return $this->getRSSAggregating();
}
Step 2 : Copy and paste the below code in your .ss file where you want to display the RSS
<% if RSSAggregating %>
<div class="rssblock" >
<% control RSSAggregating %>
<h3 class="iblockfont"><b>$Title</b></h3>
<% if SubAggregat %>
<% control SubAggregat %>
<h4><a href="$Link">$Title</a></h4>
<% end_control %>
<% end_if %>
<% end_control %>
</div>
<% end_if %>