Skatiechik Posted September 21, 2006 Share Posted September 21, 2006 The navigation bar on my website is currently seperated into a different html file and included via the use of the php includes function (website found here http://www.maestroturbo.org.uk). Very good as it means I only update one html file to change the navigation bar for the whole site. However how do I make this dynamic so I can have 2/3 levels below? So at the moment it is # Photo Gallery # Events - MGSD06 Now how do I write the php so I can change it to #Photo Gallery #Events #####Event05 #####Event06 #Technical Just to say I know nothing about PhP except the includes seperation so don't confuse me. Willing to learn though Link to comment Share on other sites More sharing options...
Stuff Posted September 21, 2006 Share Posted September 21, 2006 Simply add a new link in <li><a href="page to go to">Page name</a></li> Link to comment Share on other sites More sharing options...
Skatiechik Posted September 21, 2006 Author Share Posted September 21, 2006 Simply add a new link in <li><a href="page to go to">Page name</a></li> Yes, but I don't want another first level link though. I wrote the website initially, I think if I can manage to add about 10 first level links then I can manage another I am asking how you make the navigation bar "dynamic". Link to comment Share on other sites More sharing options...
JoeP Posted September 21, 2006 Share Posted September 21, 2006 You need to do the navigation bar using Javascript. There are quite a few examples of this sort of code on the Web, and you can usually write a bit of PHP that will write out the Javascript for the menu, assuming the 'sub-level' entries are based on database contents. If they're not, than you should just be able to code the nav bar in Javascript in the include. I know this is a bit 'woolly' but hopefully it'll point you in the direction to look. Link to comment Share on other sites More sharing options...
Skatiechik Posted September 21, 2006 Author Share Posted September 21, 2006 Well I am glad someone knows what I am talking about. I wondered if I was talking in double dutch on my first post. No the links aren't database entries just html, but as I have the php includes function in yes hence these are name arandomlink.php I have used dynamic javascript navigation bars before, very recently for another website in development and mixed it with some PhP. Cheers for twigging my memory. The only issue I have is the free scripts seem to be created for certain graphical layouts and I wish to keep exactly the same one. I thought they may have been an easier way of doing it using php. Link to comment Share on other sites More sharing options...
JoeP Posted September 21, 2006 Share Posted September 21, 2006 Well I am glad someone knows what I am talking about. I wondered if I was talking in double dutch on my first post. No the links aren't database entries just html, but as I have the php includes function in yes hence these are name arandomlink.php I have used dynamic javascript navigation bars before, very recently for another website in development and mixed it with some PhP. Cheers for twigging my memory, I don't know why I didn't think of that. I will go and see if I can steal a script from somewhere or use my existing one. You know what Picasso said; 'Good artists copy, great artist's steal'. Good luck with it! Link to comment Share on other sites More sharing options...
John Posted September 21, 2006 Share Posted September 21, 2006 Is this what you are wanting? http://www.destroydrop.com/javascripts/tree/default.html Link to comment Share on other sites More sharing options...
Nazo Posted September 22, 2006 Share Posted September 22, 2006 It's also possible to do dropdown menus entirely in CSS without using any Javascript. It should be fairly easy to find examples in google if you're interested. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.