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.

Template Questions /

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

Cant seem to access a global Page.php function from some of my templates

Go to End

3 Posts   1316 Views


Community Member, 137 Posts

16 August 2010 at 5:35pm

Hi all, I have a bunch of different templates that includes another template ( which returns the lastupdate date via calling a function in 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');
<% if GetLatestUpdate %>
<% control GetLatestUpdate %>
<% 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


Community Member, 135 Posts

17 August 2010 at 4:09pm

Have you flushed with:



Community Member, 137 Posts

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.