Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
List of child pages in a template
#10
All

Many thanks for your help. Here's a code snippet of what I went for in the end.

Andy

PHP Code:
if (return_page_slug() == 'blog') { 
    
$submenu=getChildren('blog'); // change to $id for current page 
    
$menuArray=array();

    foreach (
$submenu as $menuitem){
        
$menuArray[(string)$menuitem]['date']=substr(returnPageField($menuitem,'url'), 010);
        
$menuArray[(string)$menuitem]['title']=returnPageField($menuitem,'title'); 
        
$menuArray[(string)$menuitem]['url']=returnPageField($menuitem,'url');
        
$menuArray[(string)$menuitem]['description']=returnPageField($menuitem,'metad');
}   
//foreach

//Sort the array in DESC order with the date of the blog
arsort($menuArray);

foreach (
$menuArray as $value)
{
        
$strBlogTitle $value['title']; 
        
$strBlogURL $value['url'];
        
$strBlogDate date('d M Y'strtotime($value['date'])); 
        
$strBlogDescription $value['description'];

        echo 
"<div class='post'><h2><a href=" $strBlogURL ">" $strBlogTitle "</a></h2></div>";

        
// All remaining echos removed as not relevant to all


}

}   
//if

?>
Reply


Messages In This Thread
RE: List of child pages in a template - by Connie - 2013-01-09, 01:04:47
RE: List of child pages in a template - by Carlos - 2013-01-09, 17:20:13
RE: List of child pages in a template - by Connie - 2013-01-10, 03:43:21
RE: List of child pages in a template - by Carlos - 2013-01-10, 04:22:40
RE: List of child pages in a template - by Connie - 2013-01-10, 04:57:10
RE: List of child pages in a template - by D.O. - 2013-01-10, 23:23:05
RE: List of child pages in a template - by andy.storey - 2013-01-10, 23:40:13
RE: List of child pages in a template - by Connie - 2013-01-11, 18:03:45
RE: List of child pages in a template - by D.O. - 2013-01-12, 18:32:48
RE: List of child pages in a template - by Carlos - 2013-01-17, 05:20:09
RE: List of child pages in a template - by D.O. - 2013-01-17, 05:47:49
RE: List of child pages in a template - by Carlos - 2013-01-17, 05:55:02
RE: List of child pages in a template - by D.O. - 2013-01-17, 06:07:35
RE: List of child pages in a template - by Carlos - 2013-01-17, 07:01:02
RE: List of child pages in a template - by D.O. - 2013-01-17, 19:17:26



Users browsing this thread: 1 Guest(s)