Hi thanks for the help. Although I doesnt seem to be getting to the getIsRecent function.
This is what I have in my template:
<% control Children %>
<li>
<a href="$Link" title="Go to: $Title.XML Portfolio Webpage" class="webbrowseImage">
<% control Images %>
$Attachment.SetWidth(407)
<% end_control %></a>
<h3><a href="$Link" title="Learn more about: $Title.XML">$Title.XML</a></h3>
<p>$Content.LimitWordCountXML(15)<a href="$Link" title="Read more: $Title.XML">More</a></p>
<a href="$Link" title="Go to: $Title.XML Portfolio Webpage" class="button">More</a>
<% if IsRecent %><div class="recentsite"></div><% end_if %>
</li>
<% end_control %>
And in the PHP page
<?php
class WebsitesBrowse extends Page {
static $db = array();
static $default_child = 'WebsitePage';
static $allowed_children = array(
'WebsitePage' => 'WebsitePage'
);
static $has_many = array(
'WebsitePage' => 'WebsitePage'
);
static $singular_name = 'Website Overview';
static $plural_name = 'Websites Overview';
static $icon = "cms/images/treeicons/web";
public function getCMSFields(){
$fields = parent::getCMSFields();
$fields->removeFieldFromTab("Root.Content.Main", "Content");
return $fields;
}
}
class WebsitesBrowse_Controller extends Page_Controller {
function getIsRecent() {
return strtotime($this->LastEdited) > strtotime('-10 days');
}
}