Hi Guys
I'm new to SS and was just wondering if you guys could help me out with the Article Holder - to get it to have the articles to descend by date.
Ive added this to my ArticleHolder.php
function LatestNews($num=5) {
$news = DataObject::get_one("ArticleHolder");
return ($news) ? DataObject::get("ArticlePage", "ParentID = $news->ID", "Date DESC", "", $num) : false;
}
But when i go to the articleholder page it only displays ArticleHolder content, and not the Article Pages. But if i delete the above coding its will display the article pages but no in date decending its displayed in the order on there cms.
also this is my ArticleHolder.ss
<% control LatestNews %>
<div class="articleHolder"><br />
<div class="newsTitle">Latest News </div>
<div class="newsDateTitle"><a href="$Link" title="Read more on "{$Title}"">$Title</a></div>
<div class="newsDateTitle">$Date.Nice</div>
<div class="articleHolderClear"></div>
<div class="newsSummary">$Content.FirstParagraph <a href="$Link" title="Read more on "{$Title}"">more >></a></div>
<div class="articleHolderFooter"></div>
</div>
<% end_control %>
am i missing something?
thanks in advance,
FireMe!