Hi Guys,
I am trying to add Page, Calendar and ArticlePage page types under ArticleHolder page type.
But dont want ArticlePages in my left navigation...
1. Following is the code used in ArticleHolder.php =>
class ArticleHolder extends Page {
static $db = array(
);
static $has_one = array(
);
static $allowed_children = array("Page", "Calendar");
}
2. To add articles on ArticleHolder page - following code is used in ArticleHolder.ss =>
<% control Articles %>
<div id="NewsListL">
$Photo.SetWidth(85)
</div>
<div id="NewsListR">
<a href="$Link" title="Read more on "{$Title}"" class="title">$Title</a><br/>
<span class="newsDate">$Date.Nice</span><br/>
$Content.FirstParagraph <a href="$Link" title="Read more on "{$Title}"">Read more >></a>
</div>
<div class="clear"></div>
<% end_control %>
3. And in Page.php - I am using following code =>
function Articles() {
return DataObject::get('ArticlePage');
}
4. Code in Sidebar.ss =>
<% control Menu(2) %>
<% if Children %>
<li>
<a href="$Link" title="$Title" class="$LinkingMode">$MenuTitle<span class="greenArrow">»</span></a>
<% if LinkOrSection = section %>
<ul id="SidebarMenu1">
<% control Children %>
<li><a href="$Link" title="$Title" class="$LinkingMode"><span>$MenuTitle</span></a></li>
<% end_control %>
</ul>
<% end_if %>
</li>
<% else %>
<li>
<a href="$Link" title="$Title" class="$LinkingMode"><span>$MenuTitle</span></a>
</li>
<% end_if %>
<% end_control %>
Is there any way not to include Article pages in left navigation on ArticleHolder page or any of its sub pages????
Kind Regards
Anaya...