|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (10 bit)
Join Date: Mar 2006
Location: Toronto, Canada
Posts: 810
|
XHTML function similar to PHP includes?
Seems like I ruined the other topic by using the tag "iframe". Can a mod please delete it please?
![]() Hello all... Been dabbling in XHTML 1.0 ever since I discovered it. Quite handy, and makes web development fun again. One thing I've noticed is that while my styles are all based on CSS (another fun development), if I change the content of, say, a menu bar, I still have to go and edit every single html page on my website to change the menu bar. I know PHP has the "include" function to include bits of other scripts in the parent script... and I know I could probably make something work out of XML and XSLT, but it does look rather complex... Is there something I can do in XHTML that doesn't involve the use of "object" or "iframe"? Last edited by Kareeser; 04-03-2007 at 09:53 AM. Reason: removed extra bit in totle, spellcheck |
|
|
|
|
|
#2 |
|
Staff
Premium Member
Join Date: Jul 1999
Location: Arlington, TN
Posts: 5,538
|
Thread deleted.
Build an external stylesheet and link it. Example: <link href="URL.css" rel="stylesheet" type="text/css" />
__________________
Want to Make $$$$ with your Computer? No Risk! Simply press shift-4 four times in a row |
|
|
|
|
|
#3 |
|
Member (10 bit)
Join Date: Mar 2006
Location: Toronto, Canada
Posts: 810
|
Hm... I was under the impression that using an external stylesheet was only good for separating form and content, which I've already done...
I also thought you couldn't (or rather, "shouldn't) put content in an external style sheet... ![]() Some more detail about what I want to achieve: menu.html Code:
... some code for a menu Code:
code for the menu <-- dynamically added to the page additional page content Last edited by Kareeser; 04-03-2007 at 09:57 AM. |
|
|
|
|
|
#4 |
|
Staff
Premium Member
Join Date: Jul 1999
Location: Arlington, TN
Posts: 5,538
|
Sorry I misunderstood your question.
Includes with php would be the way to go. A very simple way would be to build your menu then separate out that part of the menu into a separate file commonly called menu.inc (the extension doesn't mean anything, it just tells you that it is an included file), then include it: <?php include("menu.inc"); ?> That is a very simple approach. An overall better strategy is to design your site, then hook it up to a CMS like Joomla. That way you have dynamic menus, pages and a whole bunch of other stuff. |
|
|
|
|
|
#5 |
|
Member (10 bit)
Join Date: Mar 2006
Location: Toronto, Canada
Posts: 810
|
Ah, I can't believe how simple it is to use...
Reduced my index page from 30k to under 1k ![]() Thanks! Next problem... every time I change an included page, php spits out an error saying the file no longer exists... I think it has something to do with page caching, but I could be wrong... any help? Last edited by Kareeser; 04-03-2007 at 01:50 PM. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| WD 500 GB hard drive | TwoRails | Computer Hardware | 2 | 09-12-2006 08:56 AM |
| Computer Acronyms | Floppyman | Computer Hardware | 156 | 06-18-2006 06:25 AM |
| Post-install script for dapper drake | rightcoast | Linux OS and Software Assistance | 2 | 06-05-2006 08:30 PM |
| Overclock Suggestions? | ShannonLi | Computer Hardware | 9 | 08-04-2004 11:24 AM |