WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.6 is now available!


Will it continue with WB? It goes on! | Geht es mit WB weiter? Es geht weiter!
https://forum.websitebaker.org/index.php/topic,32340.msg226702.html#msg226702


The forum email address board@websitebaker.org is working again
https://forum.websitebaker.org/index.php/topic,32358.0.html


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Droplets & Snippets »
  • show childpages and childpages of childs in the parentpage
  • Print
Pages: [1]   Go Down

Author Topic: show childpages and childpages of childs in the parentpage  (Read 4668 times)

Offline Craxx

  • Posts: 266
show childpages and childpages of childs in the parentpage
« on: February 20, 2010, 02:06:06 PM »
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
Logged
Craxx;)

Offline Monky

  • Posts: 47
  • Gender: Male
    • Segelclub Würmsee Starnberg e.V.
Re: show childpages and childpages of childs in the parentpage
« Reply #1 on: February 21, 2010, 08:50:00 PM »
Hi, I am trying to help a bit.

1. Your line
Code: [Select]
if ($page_id) { doesnt make sense. I guess you mean something like
Code: [Select]
if ($page_id == 42) {2. Your Query does
Code: [Select]
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
Code: [Select]
ORDER BY parent, positionI'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.
Logged

Offline Craxx

  • Posts: 266
Re: show childpages and childpages of childs in the parentpage
« Reply #2 on: February 22, 2010, 11:10:35 AM »
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
« Last Edit: February 22, 2010, 08:27:03 PM by Craxx »
Logged
Craxx;)

Argos

  • Guest
Re: show childpages and childpages of childs in the parentpage
« Reply #3 on: March 22, 2010, 09:56:38 AM »
Sounds like a regular sitemap to me, starting at a certain page.

As a droplet:
http://www.websitebakers.com/pages/droplets/official-library/navigation/sitemapchild.php

As module:
http://www.websitebakers.com/pages/modules/listings/section-pages/sitemap.php
Logged

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Droplets & Snippets »
  • show childpages and childpages of childs in the parentpage
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2