473,386 Members | 1,763 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Can I write some code and have it imported like a stylesheet?

Hi.

I suppose this is really a HTML question, but I'm sure that someone
can help.

Having got a working set of menu's on the left of a test page, I note
that I have got several copies of it, one in each page. With a
stylesheet I can import an external file which is held once, with the
well known benifets.

Can I do the same with HTML? I'd like to be able to have a seperate
file, say 'navigation.htm' which gets called into the main page when
needed.

It's probably a wellknown feaure to you experts, but I have no ideas,
yet!

Thanks in advance to all who take their time to answer these silly
questions.
Aug 30 '05 #1
5 1244
try php - html won't help...

<? php

include 'heading.inc'
include 'navigation.inc'
include 'main.inc'
include 'footer.inc'

?>

save as index.php

create the files heading.inc etc containing the html exactly as yo
would have created it for each part of the original html page.

good luck

Aug 30 '05 #2
On 2005-08-30, Mike Barnard <m.****************@thunderin.co.uk> wrote:
Can I do the same with HTML? I'd like to be able to have a seperate
file, say 'navigation.htm' which gets called into the main page when
needed.


http://www.htmlhelp.com/faq/html/des...l#include-file
Aug 31 '05 #3
On Tue, 30 Aug 2005 21:48:00 +0100, Mike Barnard
<m.****************@thunderin.co.uk> wrote or quoted :
Can I do the same with HTML? I'd like to be able to have a seperate
file, say 'navigation.htm' which gets called into the main page when
needed.


there are at least three ways to get that effect:

1. SSI server side includes. See http://mindprod.com/jgloss/ssi.html

2. JSP or other servlet womb where you dynamically generate the web
pages.

3. static macros. This is how I do my own website. Just before I
upload to the website I have a program run through looking for macros
embedded in the html, e.g. <!-- macro Foot --> or <!-- macro Include
E:\mindprod\bushmenu.html -->. It expands these.
If you look for example at http://mindprod.com/jgloss/colours.html
you will see menu of possible colour palettes. It is similar on every
page it is used, but not quite. The macro highlights the option you
are currently using. The macros can be intelligent, gathering images,
figuring out image sizes, The price list page at
http://mindprod.com/products.html generates different HTML depending
on which bit are actually available. Prices are displayed by a an
applet that displays in the user's home currency.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
Sep 2 '05 #4
On Tue, 30 Aug 2005 21:48:00 +0100, Mike Barnard
<m.****************@thunderin.co.uk> wrote:
A quick thanks to all that have replied. My ISP hosts just about all
the proffered options, so a bit of research into the 'best' is
required. As for the caching, that too is something I'll have to look
at. Any links? :)

Cheers, and please look at my 'site'critique' message below.
--
Regards from Mike and Jan Barnard.
South Coast, UK.

[To reply by email remove ".trousers" spamtrap from email address]

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Sep 2 '05 #5
Mike Barnard schreef:
On Tue, 30 Aug 2005 21:48:00 +0100, Mike Barnard
<m.****************@thunderin.co.uk> wrote:
A quick thanks to all that have replied. My ISP hosts just about all
the proffered options, so a bit of research into the 'best' is
required. As for the caching, that too is something I'll have to look
at. Any links? :)

Cheers, and please look at my 'site'critique' message below.


Dreamweaver has two nice features: "Templates" and "Libary items", the
last one can be compared with SSI.
If you work in a team and other coeders must reuse your work,
Dreamweaver offers some good funtions, IMO.

Good luck.

--
Niek
Sep 2 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Steven An | last post by:
I'm gonna describe the situation I'm dealing with..but if you're not interested, just skip to the last line where I bluntly ask my question :) Here's my scenario: I've got a huge website that...
27
by: Sune | last post by:
Hi! Pre-requisites: ------------------- 1) Consider I'm about to write a quite large program. Say 500 K lines. 2) Part of this code will consist of 50 structs with, say, no more than at most...
1
by: Jignesh Desai | last post by:
There are essentially two ways that you can write code for an ASP.NET application. Inline code Style --------------------------------------------------------------- <html> <script...
88
by: Peter Olcott | last post by:
Cab you write code directly in the Common Intermediate language? I need to optimize a critical real-time function.
7
by: vinthan | last post by:
hi, I am new to python. I have to write test cases in python. An application is open in the desk top ( application writen in .Net) I have to write code to get focuse the application and click on...
8
by: mohammaditraders | last post by:
#include <iostream.h> #include <stdlib.h> #include <conio.h> #include <string.h> class Matrix { private : int numRows, numCols ; int elements ;
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.