Hi LeeUmm,
thanks for your answer.
Yes, I did flush the template as well as rebuilding the database.
In page.ss, I use $Layout:
/********************** code snippet
<!-- begin: main content area #main -->
<div id="main">
$Layout
</div>
<!-- end: #main -->
end code snippet ************************/
Then I wrote the template HomePage.ss which is ok in all parts except in not showing the newslist (I've set up a 3-col layout based on the css-framework YAML, col2 is the one on the right side. The framework is fine for all parts of the site there are no problems at all).
/********************** HomePage.css
<!-- begin: #col1 - first float column -->
<% include LeftColumn %>
<!-- end: #col1 -->
<!-- begin: #col2 second float column -->
<!-- <% include RightColumn %> -->
<div id="col2">
<div id="col2_content" class="clearfix">
<ul id="NewsList">
<% control LatestNews %>
<li class="newsDateTitle"><a href="$Link" title=""($Title)%quot;">$Title</a></li>
<li class="newsDateTitle">$Date.Format(j. M. Y) von $Author</li>
<li class="newsSummary">$Content.FirstParagraph <a href="$Link" title="mehr...">mehr...</a></li>
<% end_control %>
</ul>
</div>
</div>
<!-- end: #col2 -->
<!-- begin: #col3 static column -->
<div id="col3">
<div id="col3_content" class="clearfix"> <a id="content" name="content"></a>
<div id="Banner">
<img src="mysite/images/welcome.png" alt="Homepage image" />
</div>
$Content
</div>
<div id="ie_clearing"> </div>
<!-- End: IE Column Clearing -->
<!-- end: #col3 -->
end HomePage,css ************************/
While the content of col1 and col3 is shown correctly, the content of col3 is not. If I replace the current template of col2 by another template, the content the new template produces is shown.
And this is the html code generated:
/********************** code snippet
<!-- begin: #col2 second float column -->
<div id="col2">
<div id="col2_content" class="clearfix">
<ul id="NewsList">
</ul>
</div>
</div>
<!-- end: #col2 -->
end of code snippet ************************/
As you can see the control seems to not return a value so no content is beeing displayed.
The site is in dev-mode but I don't get any errors.
To complete all pieces of code, here's the controller of the HomePage.
/********************** code snippet
class HomePage_Controller extends Page_Controller {
function LatestNews($num=5) {
$news = DataObject::get_one("NewsHolder");
return ($news) ? DataObject::get("NewsPage", "ParentID = '$news->id'", "Date DESC", "", $num) : false;
}
}
end code snippet ************************/
How can I debug the result of the function LatestNews? Seems that it is false?
Thanks for your assistance.
Christian