Announcement

Collapse
No announcement yet.

Extracting the sitemap for use in navigation

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Extracting the sitemap for use in navigation

    Hey guys,

    I was wondering whether anyone knew of a way to get the list from the sitemap into other pages. Basically what I want to do is get the pages to build with the sitemap as the navigation with it being formatted by javascript so I dont have to rebuild the list manually with every change and so the navigation doesn't need too much script work going on which has caused problems for me before.

    *edit: just to be a little clearer I need just the sitemap list to layout in list form in any template page, I have the rest worked out from there! *

    Regards,

    Leonard

    #2
    Not sure if this is possible in v7 (v8 has a very handy layout to do this very thing).. there is the YahooScript which uses the section script which you may be able modify for your specific needs.


    Bikster
    SellerDeck Designs and Responsive Themes

    Comment


      #3
      I don't think in V7 you can do anything other than use the JavaScript Act_section_tree_names.js and Act_section_tree_URLs.js structures.

      If you really want an HTML list on every page then this is a compelling reason to upgrade to V8 where this sort of thing is easy to do.
      Norman - www.drillpine.biz
      Edinburgh, U K / Bitez, Turkey

      Comment


        #4
        concept:

        1 - create a blank primary template and insert only the markup required to display the nested ul/li tree that is the sitemap, for your sitemap.html

        2 - use php, create a file called sitemap.php to load the sitemap.html, and use the php functions to trim the file using xml/regex style functions.

        3 - include this php file in your pages using ssi by modifying your htaccess.

        4 - profit

        Comment


          #5
          I agree with Gabe. I was thinking of doing this in php (not had time) for customers that have requested an alphabetic list of products (so they can look up their favourites). I was going to drive it off an xml file of products, links and prices that I already produce.

          Comment


            #6
            If you have the PHP skills, then this would work fine.

            You could use existing sitemap.html file.

            Edit Act_SiteMap.html to add some markers above and below NETQUOTEVAR:SITEMAP.

            Your PHP would open sitemap.html, extract the text between the markers and echo it back out.
            Norman - www.drillpine.biz
            Edinburgh, U K / Bitez, Turkey

            Comment


              #7
              thats a better idea norm.

              HTML Code:
              <!-- sniphere -->
              NETQUOTEVAR:SITEMAP
              <!-- sniphere -->
              would do it.

              you'd have to walk the tree in xml for php and only go so deep. discard the rest and make a css show of it.

              Comment


                #8
                It could be as simple as

                <span id="startsitemap">
                NETQUOTEVAR:SITEMAP
                </span id="endsitemap">

                and the PHP could be as simple as (untested)
                Code:
                <?php
                $entiresitemap = file_get_contents('sitemap.html');
                $startpos = strpos($entiresitemap, '<span id="startsitemap">'); // start marker
                $endpos = strpos($entiresitemap, '</span id="endsitemap">');
                $entiresitemap = strstr($entiresitemap, $startpos, ($endpos - $startpos));
                echo $entiresitemap . '</span>';
                ?>
                Norman - www.drillpine.biz
                Edinburgh, U K / Bitez, Turkey

                Comment


                  #9
                  Sorry, been out of action since I posted originally so I apologise for not being able to thank you guys sooner for the help. Got a few ideas to play around with now which is great and its given me a few more ideas for the workings of the navigation too that I hadn't thought about before.

                  Once again, thanks for the great advice. You guys are legends!

                  Regards,

                  Leonard

                  Comment


                    #10
                    hear that norm.

                    we're legends.

                    w00t!

                    Comment

                    Working...
                    X