Hi,
I have a summary page where I need to show a list of that pages children (which I've done), but also need to show the last modified date of each of the children. Any ideas please?
Many thanks
Child Page last modified date
Re: Child Page last modified date
Hi Fowlerat,
I'd say you're probably going to need to add a UDT, something similar to this possibly?:
Save this as last_modified in your UDT's and then you can call it like this:
This method will return only the timestamp though, so you will want to use Smarty's format date (see smarty docs) to format it correctly.
I'd say you're probably going to need to add a UDT, something similar to this possibly?:
Code: Select all
$alias = (!empty($params['alias']) ? $params['alias'] : false);
$assign = (!empty($params['assign']) ? $params['assign'] : false);
// If alias is set
if (!empty($alias)) {
// Load defaults
global $gCms;
$contentOps =& $gCms->GetContentOperations();
$smarty =& $gCms->GetSmarty();
// If content operations could be loaded
if (!empty($contentOps)) {
// Set second option to false if you want inactive pages to be shown
$content = $contentOps->LoadContentFromAlias($alias,true);
// Retrieve the last modified timestamp
$timestamp = $content->GetModifiedDate();
// If assign is set, then set smarty variable otherwise just return the timestamp
if ($assign)
$smarty->assign($assign, $timestamp);
else
return $timestamp;
}
}
Code: Select all
{last_modified alias=$alias assign="timestamp"}
~ Life is like water, every movement you make changes the way it flows ~
Re: Child Page last modified date
Hi mrenigma,
Many thanks for your help. Exactly what I needed.
Best
Alan
Many thanks for your help. Exactly what I needed.
Best
Alan
Re: Child Page last modified date
Not that I tried this but I think you can use {menu} to
1) e.g list only children of current page
2) list the last modified date with it.
Create (copy) a new template that also prints
and call
i suspect you get the "list of that pages children" through {menu} anyway, no?
1) e.g list only children of current page
2) list the last modified date with it.
Create (copy) a new template that also prints
Code: Select all
$node->modified
Code: Select all
{menu childrenof="YourParentAlias" template="YourNewTemplate"}