This is very cool. But I need something that will walk down the pages. a html version of what you see in the left nav of Aegir under the websites tab. Instead of the page name I would like to get the <[title]> of each page instead (if available). Anyone know the algorithm for generating that page tree in Aegir? Thanks
Henri Bergius wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Vincent wrote: | Has anyone tried to create a sitemap using midgard/mysql ? | By sitemap I mean the creation of a single page that has a | public overview of your entire site. Here is an example:
The Aegir Sample Site includes a sitemap page. Also, there is a de.linkm.sitemap component for MidCOM sites.
If you're not running either you'll probably have it easiest with the nemein_draw_sitemap function from /NemeinNavBar/Utils:
<?php // void nemein_draw_sitemap($root_topic_id,$path,$how_many_levels_to_open) // Function for generating NemeinNavBar-compatible site map // If $how_many_levels_to_open is -1, then all levels will be expanded
function nemein_draw_sitemap($id,$path,$level) { ~ global $max_level; ~ $topics = mgd_list_topics($id,'score'); ~ if ($topics) { ~ echo "<ul>\n"; ~ while ($topics->fetch()) { ~ $topicsname = rawurlencode($topics->name); ~ echo "<li><a href=\"$path$topicsname/\">$topics->name</a></li>\n"; ~ if ($level < $max_level || $max_level == -1) { ~ nemein_draw_sitemap($topics->id,"$path$topicsname/",$level+1); ~ } ~ } ~ echo "</ul>\n"; ~ }
~ $articles = mgd_list_topic_articles($id,'score'); ~ if ($articles) { ~ echo "<ul>\n"; ~ while ($articles->fetch()) { ~ $articlesname = rawurlencode($articles->name); ~ echo "<li><a href=\"$path$articlesname.html\">$articles->title</a></li>\n"; ~ } ~ echo "</ul>\n"; ~ }
} ?>
/Bergie
- -- Henri Bergius [EMAIL PROTECTED] Consultant Partner Tel: +358-20-198 6032 Nemein Oy http://www.nemein.com/
Nemein.Net -- Project tracking solution for consulting companies http://www.nemein.com/en/nemeinnet/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE/mUB7NkT8k497k9IRAiMZAKCogYapo1mNEB8OsCFJ3GY+sG47qQCdHpwM ObLDoJLCndnP0trMBfYnucE= =22l+ -----END PGP SIGNATURE-----
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
