Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Include of external HTML or CSS trick 2

Status
Not open for further replies.

MasterRacker

New member
Oct 13, 1999
3,343
US
I would like to create a standard address bar that I can include at the end of every page on an intranet. However, I would like to be able to edit the links in one place and have them change on every page. There doesn't seem to be a way to create an acutal link in an external stylesheet and I don't see a mechanism for doing an "include" of html from an external file.

The only method I've been able to think of would be to create a jscript that reads and external file and writes it ot the current document but that seems to be a pretty obtuse way of going about it. Being pretty green with web coding, I feel I must be missing a simple way to do this. Anyone?
Jeff
I haven't lost my mind - I know it's backed up on tape somewhere ....
 
Hi MasterRacker,

This was posted in my thread by Boomerang :
I think it might be of some use to you ???

Hi BobbaFet,

If you have the opportunity to use Include-files (SSI) you can make a sort of headerdefault-include file.
[for example if you use ASP-server side script, but I read some posts here that you can also make include files by other ways, but I don't have experience with that]:

<head>
<!--#INCLUDE VIRTUAL=&quot;/headerdefaults.htm&quot;-->
</head>

put this in the file 'headerdefaults.htm':

<link rel=&quot;stylesheet&quot; href=&quot;/yourCSSfile.css&quot; type=&quot;text/css&quot;>
<base target=&quot;_self&quot;>

Now you only have to code the target once, and write the <!--#INCLUDE VIRTUAL=&quot;/headerdefaults.htm&quot;--> in the pages where the target is used. If you have pages where you don't use the target you can only write the
<link rel=&quot;stylesheet&quot; ......> in your <head>

If you also use a javasript file you can also put this in the 'headerdefaults.htm':

<script language=&quot;JavaScript&quot; type=&quot;text/javascript&quot; src=&quot;/javascript/yourJSfile.js&quot;></script>

Hope this helps,
Erik


Thank him if it's helpfull to you !!!


BobbaFet

Everyone has a right to my opinion.
E-mail me at cwcon@programmer.net
Be a nice guy 'n press that little ol' button
VVV---(this one) for me ;-)
 
Doesn't appear to work for a displayable element in the body.
Jeff
I haven't lost my mind - I know it's backed up on tape somewhere ....
 
Insert this where you want the address bar to appear.

<object type=&quot;text/x-scriptlet&quot; width=&quot;60%&quot; height=&quot;250&quot; data=&quot;addressbar.html&quot;>
</object>

Hope it works,
Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top