Common Index in HTML/CSS
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- Common Index in HTML/CSS
Common Index in HTML/CSS
04-12-2010 5:38 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I want a series of web pages which will be in separate folders but I want to have a standard index either at the side or at the top.
Now I can create the basic layout using a CSS style sheet but the question is whether the index with html links can also be incorporated into a style sheet so that any change to the index will ripple through all the pages.
PS I don't want to use frames
Re: Common Index in HTML/CSS
04-12-2010 7:26 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
In order to test the code I need to do it off line - has anyone tried QuickPHP http://www.zachsaw.co.cc/?pg=quickphp_php_tester_debugger&sub=quickphp_php_tester_debugger_moreinfo
Re: Common Index in HTML/CSS
04-12-2010 8:30 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
For example:
document.write('<ul>');
document.write('<li><a href="1.htm">One</a></li>')
document.write('<li><a href="2.htm">Two</a></li>')
document.write('<li><a href="3.htm">Three</a></li>')
document.write('<li><a href="4.htm">Four</a></li>')
document.write('</ul>');
Place the javascript in an external file and call the external javascript into each page that requires it.
This should satisfy the requirement to only maintain the index in one place.
If you call the external javascript within a named DIV, CSS can be used to control the location of that DIV.
Any use?
Re: Common Index in HTML/CSS
04-12-2010 9:00 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Re: Common Index in HTML/CSS
04-12-2010 9:01 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Re: Common Index in HTML/CSS
04-12-2010 9:02 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Re: Common Index in HTML/CSS
04-12-2010 9:25 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
what you need is to be able to include one file inside another, have a look at this site for some ideas http://ask-leo.com/how_do_i_include_one_html_file_inside_another.html . Don't know what options are supported on the plusnet webspace though!
Vip3r.
Re: Common Index in HTML/CSS
04-12-2010 10:52 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Re: Common Index in HTML/CSS
04-12-2010 11:13 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
You'll need to add the following to .htaccess
AddHandler server-parsed .shtml
AddType text/html shtml
Then make your pages that need to include the common header have .shtml extension.
Within the pages you put
<!--#include virtual="filename.xxx"-->
The filename and extension can be anything you like.
jelv (a.k.a Spoon Whittler) Why I have left Plusnet (warning: long post!) Broadband: Andrews & Arnold Home::1 (FTTC 80/20) Line rental: Pulse 8 Home Line Rental (£14.40/month) Mobile: iD mobile (£4/month) |
Re: Common Index in HTML/CSS
05-12-2010 9:57 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Re: Common Index in HTML/CSS
05-12-2010 10:09 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
jelv (a.k.a Spoon Whittler) Why I have left Plusnet (warning: long post!) Broadband: Andrews & Arnold Home::1 (FTTC 80/20) Line rental: Pulse 8 Home Line Rental (£14.40/month) Mobile: iD mobile (£4/month) |
Re: Common Index in HTML/CSS
05-12-2010 10:23 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Re: Common Index in HTML/CSS
05-12-2010 10:27 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
This is what is called a relative link. The location of one file is specified relative to the current file. All links should be entered this way (except external ones obviously).
One benefit of relative linking is the whole set of files can be moved to a new directory or server and all the links will remain correct.
Re: Common Index in HTML/CSS
05-12-2010 10:45 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I use a header.php holding all the stuff from the Doctype Decleration to the <body> tag. I also include a global footer.php which includes the footer stuff and the </body> tag.
Basically:
<?php include 'header.php'; ?>
webpage code
<?php include 'footer.php'; ?>
Bear in mind that the various webpages will have different header data (title, keywords etc.), so it might be worthwhile sitting down and thinking about how best to pull in the global data without messing with the page-specific stuff.
As for testing, I'm using XAMPP, which provides a local Apache dist on the PC. Just pull your files to the htdocs folder, and use the url 127.0.0.1 in the browser.
http://www.apachefriends.org/en/xampp.html
Re: Common Index in HTML/CSS
05-12-2010 4:37 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
AddHandler server-parsed .html
AddType text/html html
Note that this can be html and or shtml at least on Plusnet's server this works. If all the pages are already written this makes it a bit easier as there is no need to alter the file type on each page.
Cheers
John
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- Common Index in HTML/CSS