Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multiple page in template / Content Slider theme
#11
Why not use getChildren to get all the child pages of your index page and output them ...

sample code here....

Code:
$pages=getChildren('news');
    $mypageArray=array();
    foreach ($pages as $page){
        $mypageArray[(string)$page]['menuOrder']=returnPageField($page,'submenuorder');
        $mypageArray[(string)$page]['url']=returnPageField($page,'slug');
    }
    $pages= sort2d($mypageArray,'menuOrder','desc', FALSE);
    foreach ($pages as $page){
        $output=returnPageField($page['url'],'content');
        // you can use returnPageContent if your not going to need any other fields...
        
        // echo your output in DIVs or whatever here...
    }

edit:

I use sort2d in my code for sorting arrays:

here's the code

Code:
function sort2d ($array, $index, $order='asc', $natsort=FALSE, $case_sensitive=FALSE)  
    {
        if(is_array($array) && count($array)>0)  
        {
           foreach(array_keys($array) as $key)  
               $temp[$key]=$array[$key][$index];
               if(!$natsort)  
                   ($order=='asc')? asort($temp) : arsort($temp);
              else  
              {
                 ($case_sensitive)? natsort($temp) : natcasesort($temp);
                 if($order!='asc')  
                     $temp=array_reverse($temp,TRUE);
           }
           foreach(array_keys($temp) as $key)  
               (is_numeric($key))? $sorted[]=$array[$key] : $sorted[$key]=$array[$key];
           return $sorted;
      }
      return $array;
    }
My Github Repos: Github
Website: DigiMute
Reply


Messages In This Thread
Multiple page in template / Content Slider theme - by n00dles101 - 2012-04-07, 04:38:56



Users browsing this thread: 1 Guest(s)