show childpages and childpages of childs in the parentpage

Argos

Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
----------------------------------------------------------------
Please don't request personal support, use the forums!

Craxx

Hy Monky,

thx for answer. I tested with following code, but i changed id from your 42 to 23 because handbuch is 23 and i sort by page_trail because parent and position doesn´t work. With this code it works :):

if ($page_id == 23) {
   $db = new database();  
   $q = $db->query("SELECT * FROM ".TABLE_PREFIX."pages WHERE root_parent = '$page_id' ORDER BY page_trail");
   while ($d = $q->fetchRow()) {
       $wb->page_id = $d['page_id'];
       page_content();
   }
} else {
   page_content();
}


best regards
Craxx
Craxx;)

Monky

Hi, I am trying to help a bit.

1. Your line if ($page_id) { doesnt make sense. I guess you mean something like if ($page_id == 42) {
2. Your Query does ORDER BY page_id so of course the result is ordered by page_id  :wink:
I threw a quick glance in the pages table of my page and I think the ordering you want is something like
ORDER BY parent, position
I'm not really sure though if this grants exactly the result you want. If might be easier (though uglier) to make several queries: one for each child of "Handbuch". You can then sort those queries by position.

Craxx

Hy WB-Gurus:),

i have the following problem. I have a page called "Handbuch" below this page there are several topics an subtopics.



To print the complette Handbook (Handbuch) at once, it should be shown under Handbuch with all Topics and subtopics. For this i need some Code. I have tested the following code from a Thread:

<?php
if ($page_id) {
    $db = new database();   
    $q = $db->query("SELECT * FROM ".TABLE_PREFIX."pages WHERE root_parent = '$page_id' ORDER BY page_id");
    while ($d = $q->fetchRow()) {
        $wb->page_id = $d['page_id'];
        page_content();
    }
} else {
    page_content();
}
?>

With this code i get the topics and subtopics, but not really right. The it is not one after another like we can see the topics on left side, i think it is after the ID. I also tested the Aggregator Modul, but there is only the possibility for only Parent and Child no childs from the childs:)

Please help me?

best regards and THX a lot:)
Craxx
Craxx;)