Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Customising the CMS /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Ability to update different page sections within the same page

Go to End

9 Posts   2613 Views


Community Member, 7 Posts

10 May 2010 at 7:08am

Apparently I am doing something wrong or not doing something entirely. Here is what I have: located in themes/blackcandy/templates/Layout/ (I just kept the same name blackcandy yet it has been modified)

<div id="headStrong" class="Newstypography">
<h2>LATEST NEWS</h2>
<div id="ContentNews" class="typography">
<ul id="NewsList">
<% control LatestNews %>
<li class="newsDateTitle">$Title</li>
<li class="newsDateTitle">$Date.Nice</li>
<li class="newsSummary">$Content.FirstParagraph Read more >></li>
<% end_control %>

HomPage.php: located in mysite/code/HomPage.php


class HomePage extends Page {
function LatestNews($num=3) {
$news = DataObject::get_one("ArticleHolder");
return ($news) ? DataObject::get("ArticlePage", "ParentID = $news->ID", "", "", $num) : false;
?> located in templates/

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "">
<html xmlns="" xml:lang="en" >

<% base_tag %>
<title><% if MetaTitle %>$MetaTitle<% else %>$Title<% end_if %> &raquo; Your Site Name</title>
<link rel="shortcut icon" href="/favicon.ico" />

<% require themedCSS(layout) %>
<% require themedCSS(typography) %>
<% require themedCSS(form) %>

<!--[if IE 6]>
<style type="text/css">
@import url(themes/blackcandy/css/ie6.css);

<!--[if IE 7]>
<style type="text/css">
@import url(themes/blackcandy/css/ie7.css);
<div id="BgContainer">
<div id="Container">
<div id="Header">
<!--<div id="searchForm">$SearchForm</div>-->

<div id="Navigation">
<% include Navigation %>

<div class="flash">


<div class="copyHome">
<div id="Layout">

<div id="Footer">
<% include Footer %>


I am using and to display the news articles on a news page, but am not able to get the same thing on the hompage. Is there something else that needs to be done within the admin?

Thanks Again for all the assistance.

Go to Top