jimmydreams Posted September 11, 2007 Share Posted September 11, 2007 Hello..I have a website that makes use of a jump menu created in Dreamweaver. This menu lists the different herbs I grow with links so the viewer is diected to the herb when the name is clicked on..http://steelesherbgarden.com/thg07_theherbgallery.phpThis menu is on every herb page listed, so when I need to add an herb or delete one, I have to change the code for the jump menu list on every herb page, which is quite time consuming! Is there a way to put this herb list and/or jump menu directly in a .css file so I can make changes to the one file and have it take effect on all the herb pages?Thanks for any help. Link to comment Share on other sites More sharing options...
boen_robot Posted September 11, 2007 Share Posted September 11, 2007 It seems you have PHP. Try to use it's power to your advantage.In your current PHP file, leave only the menu and everything else that's common to every page. Then, at the place where page specific content should appear, add <?phpinclude $_GET['page'];?> You'll have to rework the links in your menu to be like ?page=file.html instead of file.html Once that is made, the full contents each page will be included alongside the common one. You may want to strip out the common content from the rest of the pages, as otherwise that will be included too. If you have PHP5, there's an easy way with which you won't have to do that, but it's a little harder if you have PHP4. Link to comment Share on other sites More sharing options...
justsomeguy Posted September 11, 2007 Share Posted September 11, 2007 It's probably better to actually leave the content in place, and include the menu and whatever else in each page. That way you don't have to change the links or filenames. Link to comment Share on other sites More sharing options...
jimmydreams Posted September 12, 2007 Author Share Posted September 12, 2007 Thank you both for your input... it makes sense and I will begin my attempt to make changes. I installed PHP 5 and I do understand the theory you suggest so I'll give it a try. Thank you Link to comment Share on other sites More sharing options...
jimmydreams Posted September 12, 2007 Author Share Posted September 12, 2007 It's probably better to actually leave the content in place, and include the menu and whatever else in each page. That way you don't have to change the links or filenames.I decided to leave the content in place and call for the menu thru php as suggested.I created a php file called "thg_gallery_menu.php" with all the info and links and put in online here... http://steelesherbgarden.com/theherbgaller...allery_menu.phpI also created a test page "thg_test_menu.php" with this PHP code where the menu normally is <? php>include $_GET[thg_test_menu.php];?>. I put this online.When I click the last entry in my test gallery menu (Test Menu )I get the following warning on the test page "Warning: main(): Failed opening '' for inclusion (include_path='.:/usr/local/lib/php') in /home/content/j/i/m/jimmydreams/html/theherbgallery/thg_test_menu.php on line 169"You can view the test page to see the warning where the Menu should be http://steelesherbgarden.com/theherbgaller...g_test_menu.phpI am not quite sure how to resolve this.Thank you. Link to comment Share on other sites More sharing options...
justsomeguy Posted September 12, 2007 Share Posted September 12, 2007 <?php include 'thg_test_menu.php';?>http://www.php.net/manual/en/function.include.php Link to comment Share on other sites More sharing options...
jimmydreams Posted September 12, 2007 Author Share Posted September 12, 2007 <?php include 'thg_test_menu.php';?>http://www.php.net/manual/en/function.include.php Thank You for your help...it worked great! I am only three months learning css and php at the same time so I realize I have a lot to learn. This site is the result so far. I will gladly look over the link you sent above and continue my learning. Thanks again Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.