21287 Posts in 5733 Topics by 2602 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 548 Views |
-
unable to show data from database in front end

3 April 2010 at 11:32pm
i have included this code in my ArticlePage as
function LatestNews($num=5) {
$news = DataObject::get_one("ArticleHolder");
return ($news) ? DataObject::get("ArticlePage", "ParentID = $news->ID", "Date DESC", "", $num) : false;
}and
<ul id="NewsList">
<% control LatestNews %>
<li class="newsDateTitle"><a href="$Link" title="Read more on "{$Title}"">$Title</a></li>
<li class="newsDateTitle">$Date.Nice</li>
<li class="newsSummary">$Content.FirstParagraph<a href="$Link" title="Read more on "{$Title}"">Read more >></a></li>
<% end_control %>
</ul>in ArticlePage.ss but in front end article page it is not showing the news detail
please help
-
Re: unable to show data from database in front end

5 April 2010 at 4:48am
The method DataObject::get_one() returns only one DataObject.
I would try to get out what the controller method really returns with Debug:log()
| 548 Views | ||
|
Page:
1
|
Go to Top |


