Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-22-2006, 02:18 PM   PM User | #1
keissfootball
New Coder

 
Join Date: Jun 2006
Posts: 62
Thanks: 0
Thanked 0 Times in 0 Posts
keissfootball is an unknown quantity at this point
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...
keissfootball is offline   Reply With Quote
Old 08-22-2006, 03:09 PM   PM User | #2
Fumigator
UE Antagonizer


 
Fumigator's Avatar
 
Join Date: Dec 2005
Location: Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
Posts: 7,686
Thanks: 42
Thanked 637 Times in 625 Posts
Fumigator is a glorious beacon of lightFumigator is a glorious beacon of lightFumigator is a glorious beacon of lightFumigator is a glorious beacon of lightFumigator is a glorious beacon of light
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.
Fumigator is offline   Reply With Quote
Old 08-22-2006, 03:37 PM   PM User | #3
keissfootball
New Coder

 
Join Date: Jun 2006
Posts: 62
Thanks: 0
Thanked 0 Times in 0 Posts
keissfootball is an unknown quantity at this point
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?
keissfootball is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:34 AM.


Advertisement
Log in to turn off these ads.