Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cannot order subpages list, why?
#1
Bug 
Hi. Relatively small problem.

I can not order the subpages i want to echo with the loop:
PHP Code:
   <?php
      $children
=getChildren('term-conditions');
 
     $ordered subval_sort($children'menuOrder');
    
?>
    <div class="parent">
      <?php foreach ($ordered as $child){?>
      <h2><?php getPageField($child'title'); ?></h2>
      <?php }; ?>
    </div> 

The $ordered variable do nothing. Why?
Reply
#2
Hello?

Can anyone can help me to order this list?
Reply
#3
(Yesterday, 03:05:04)SalamandersPL Wrote: Hello?

Can anyone can help me to order this list?

In theme folder create functions.php and add this code:
PHP Code:
function getChildrenTitle($page)
{
    $children getChildren($page);
    foreach ($children as $subpage)
    {
        $title returnPageField($subpage,'title');
        echo '<div class="parent">';    
            echo 
'<h2>'.$title.'</h2>';
        echo '</div>';
    }    


Call the function in template:
PHP Code:
<?php getChildrenTitle('term-conditions');?>
Reply




Users browsing this thread: 1 Guest(s)