2012-06-25, 18:58:57
@fairly_new,
This will sort the submenu on Published Date (or more corectly last edited date)
To get the field value of the current page use
Hope this helps....
Code:
function getSubMenu($page){
$children=getChildren($page);
$pagesSorted = subval_sort($children,'pubdate'); // select which field to sort on.
foreach ($pagesSorted as $subpage){
$title=returnPageField($subpage,'menu');
$url=returnPageField($subpage,'slug');
echo '<li><a href="index.php?id='.$url.'">'.$title.'</a></li>';
// or use below if you have fancy urls on
//echo '<li><a href="/'.$url.'">'.$title.'</a></li>';
}
}
This will sort the submenu on Published Date (or more corectly last edited date)
To get the field value of the current page use
Code:
//will echo the title of the current page
getPageField($id,'title');
// returns the page title to the $page variable
$page = returnPageField($id , 'title' );
//return the parent of the current page
$parent = returnPageField($id, 'parent')
Hope this helps....