Jump to content

Text Content in the .css file?


jimmydreams

Recommended Posts

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

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

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

<?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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...