Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: site map

  1. #1
    New Coder
    Join Date
    Jun 2006
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts

    site map

    Hello. I'm trying to create a site map, only I don't want to update it every time when adding another section. My site map is similar to my navigation menu, so I want somehow when adding a section to navigation menu, automatically add it to site map. I have never seen how the site maps work, but I'm 99% sure that they are controlled automatically. So here's my code:

    navigation_menu.html

    Code:
    some JS
    ...
    ...
    ...
    some CSS
     ...
    ...
    ...
    and finally HTML, something like this:
    
    <ul id="primary-nav">
      <li><a href="http://www.123.lv/123.php?sc=aboutme">About me</a></li>
      <li class="menuparent"><a href="#">My marks</a>
      <ul>
          <li><a href="http://www.123.lv/123.php?sc=123">123</a></li>
          <li><a href="http://www.123.lv/123.php?sc=456">456</a></li>
          <li><a href="http://www.123.lv/123.php?sc=789">789</a></li>
     </ul>
      </li>
    </ul>
    and I want my site map like this. I want to remove id="primary-nav" (that's the only place where it is) and remove <a href="#">...</a> where class="menuparent".
    and of course I need to get rid from JS and CSS when I put this code into Site map section

    Can you help me? How can I achieve this? I suppose that I can do it with preg_replace maybe, but I don't know if it's the right way...

  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    You'd be better off in the long run by storing your navigation elements in a database or file and then creating both your menu and your sitemap from the data in your database.

  • #3
    New Coder
    Join Date
    Jun 2006
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ok I did like this:

    --- start of navigation_menu_file.php ---

    <? include='js_css.php'; ?>

    then the html code with li's , ul's etc

    --- end of navigation_menu_file.php ---

    and when I click on the link saying "Site map" on my site, it does this:

    <? include='navigation_menu_file.php'; ?>

    But I don't need to include js_css.php file again, only the html code. I thught that include_once could solve this problem, but it doesn't. Any ideas?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •