473,545 Members | 2,737 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1246
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\bus hmenu.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
1646
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 has many pages. Each page has its own content (which changes often). So I wanna use XSLT stylesheets to create these pages (so I can modify the...
27
5635
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 1K bytes of data. 3) These structs are to be used by all of the other 500K lines in various places.
1
1517
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 language="vb" RUNAT="server"> Private Sub Page_Load() Response.Write("This is Inline ASP.NET Application") End Sub
88
7986
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
5449
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 the link which in the one side and it will load the map on the other and I have to check map is loaded. Any one tell me how do I use Dispatch or any...
8
2306
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
7502
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7434
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7692
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7457
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7791
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6026
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5078
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3491
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1045
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.