Multi-level page hierarchy

menu with non dynamic content

  1. if the menu structure is fixed then you can create a fixed menu using the “new” wp menu system (quadrillion weblog postings on that)

menu with dynamic content

  1. if the menu structure is not fixed you can:

    a. ask the users to manually maintain the menu after e.g. adding a new category

    b. try to hook on everything that goes in the menu e.g. a new category and add it to the menu to prevent these manual actions for your users

    c. choose another “non-wp” menu and fill that dynamically on each page load (obviously with caching). example: to put a counter (67) behind the entries that represent tag pages

In case of option (c) I would go to e.g.: http://www.mycssmenu.com/ generate the code for a menu you like, then copy and paste the javascript and css for that menu in your header.php of your theme. (I don’t know who owns that site but the GUI system for creating a new menu is absolute very cool).

Then replace the content bits (really simple: only the li items) with some code that e.g. queries the amount of categories in a hierarchical loop and replace the li items by dynamic output.

–> In that way you have a dynamic menu with dynamic content and you can play with the code to do whatever you like with it in your menu.

Example

The menu generator generated me .css and .javascript and my example content of the menu. I replaced the example content with calls to a function “taglinklineRounded”:

<li><a class="qmparent" href="https://wordpress.stackexchange.com/questions/2303/javascript:void(0)">ARTS</a>
        <ul>
        <li><span class="qmtitle" >Listen</span></li>
        <?php echo taglinklineRounded('music',    'Music') ?>
        <?php echo taglinklineRounded('radio',    'Radio') ?>
        <li><span class="qmdivider qmdividerx" ></span></li>
        <li><span class="qmtitle" >Look</span></li>
        <?php echo taglinklineRounded('comics',   'Graphics') ?>
        <?php echo taglinklineRounded('photo',    'Photo') ?>
        <?php echo taglinklineRounded('graphics', 'Graphics') ?>
        <?php echo taglinklineRounded('art',      'Art') ?>
        <li><span class="qmdivider qmdividerx" ></span></li>
        <li><span class="qmtitle" >View</span></li>
        <?php echo taglinklineRounded('tv',       'TV') ?>
        <?php echo taglinklineRounded('video',    'Video') ?>
        <?php echo taglinklineRounded('movie',    'Movie') ?>
        <li><span class="qmdivider qmdividerx" ></span></li>
        <li><span class="qmtitle" >Read</span></li>
        <?php echo taglinklineRounded('book',     'Book') ?>
        <?php echo taglinklineRounded('writing',  'Writing') ?>
        <?php echo taglinklineRounded('news',     'News') ?>
        <li><span class="qmdivider qmdividerx" ></span></li>
        <li><span class="qmtitle" >Specific</span></li>
        <?php echo taglinklineRounded('scifi',    'Sci-Fi') ?>
        <?php echo taglinklineRounded('lost',     'LOST') ?>
        </ul></li>

The taglinklineRounded function gives me the amount of entries that have this tag (but obviously any whatever code can be done on the menu structure).

In a more dynamic approach you read the categories / whatever other content needs to be in the menu and instead of in the example the hardcoded ‘scifi’ … replace it with an echo statement of the output of that categories.

(also ofcourse as deep as you want represented in the style choosen).

Other idea

I guess you can even combine the standard wp menu with the dynamic menu by having certain parts in the menu managed by the users and others dynamic by combining the outputs in a new dynamic menu. Haven’t played with that.