3217 Posts in 853 Topics by 812 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 773 Views |
-
Cant seem to access a global Page.php function from some of my templates

16 August 2010 at 5:35pm
Hi all, I have a bunch of different templates that includes another template (updatetopbar.ss) which returns the lastupdate date via calling a function in Page.php
Page.php
class Page extends SiteTree {
public static $db = array(
);
public static $has_one = array(
);
function GetLatestUpdate(){
return DataObject::get_one('UpdatesPage', '', true, 'Created DESC');
}updatetopbar.ss
<% if GetLatestUpdate %>
<% control GetLatestUpdate %>
$Date.Nice
<% end_control %>
<% end_if %>Now for some reason on half of my templates $Date.Nice simply does not populate and I can't figure out why!
Any help would be great
-
Re: Cant seem to access a global Page.php function from some of my templates

17 August 2010 at 4:09pm
Have you flushed with:
?flush=all
-
Re: Cant seem to access a global Page.php function from some of my templates

17 August 2010 at 4:10pm
hi ampedup yes, sorry this question is closed it was to do with me not having my page controller setup correctly.
| 773 Views | ||
|
Page:
1
|
Go to Top |


