Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > using the same code across multiple html docs?

using the same code across multiple html docs?
Thread Tools
black bear theory
Grizzled Veteran
Join Date: Aug 2005
Location: fairbanks AK
Status: Offline
Reply With Quote
Oct 24, 2007, 05:54 PM
 
i've made a css menu for a site and would like to find an easy way to use the same code across each html page. i was doing the simple copy'n'paste for a while, but now that the number of pages is above 30, that method is a pain.

i've tried putting it in an <object> tag, but that doesn't look right (scrollbars and such).

aside from doing a SSI (i'm on dreamhost - don't know if that's an option), is there any other tricks that i can try? any suggestions?
Earth First! we'll mine the other planets later.
     
Chuckit
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Oct 24, 2007, 06:58 PM
 
Fairly sure Dreamhost supports SSI, and it definitely supports PHP.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
Catfish_Man
Mac Elite
Join Date: Aug 2001
Status: Offline
Reply With Quote
Oct 25, 2007, 01:28 AM
 
     
mdc
Addicted to MacNN
Join Date: Feb 2003
Location: NY²
Status: Offline
Reply With Quote
Oct 25, 2007, 01:32 PM
 
* Rename your documents to .php
* Create a file called something like menu.php and put the CSS Menu code in it
* In your .php files at the location you want the menu put this <? include 'menu.php'; ?>

Done.
     
   
 
Forum Links
Forum 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
Top
Privacy Policy
All times are GMT -4. The time now is 09:29 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,