PDA

View Full Version : CSS link to text file


excaliber
02-28-2003, 07:30 PM
I need to link a large applet menu to a text file with css so I can male changes easily and lighten the page weight. Is this possible? If so how can it be done. tks for the responses.

Mr J
02-28-2003, 08:25 PM
To link to a .css file place the following in the HEAD section

<LINK href="YOURFILENAME.css" rel=stylesheet type=text/css>

excaliber
02-28-2003, 09:02 PM
Thanks M J
Thats not working for me. Perhaps I need to get another way to do this. I would really like to remove the whole applet and
replace it with a script or link that would take the plave of the applet yet display the applet as if it were ther on the page.
This is an example of the structure:


param name="menu" value="
(Company}
{ Index Page,index.html,blank}
{ Company,company.html,parent}
{ Who Are We,about.html,parent}
{ Global Vision,vision.html,parent}
{ Website Search,wgindex.html,parent}
{ Portfolio,portfolio.html,parent}
{ Locations,locations.html,parent}
{ Employment,opportunity.html,parent}
{ Policy,policy.html,parent}
{ Contact Us,contact.html,parent}
{ Give Us Feedback,feedback.html,self}"

The menu goes on for a couple gundred lines. Maybe php or javascript can do this.

nickoli21
03-01-2003, 12:08 AM
I think it would be the same amount of work with javascript, php or css. It's just a matter of the link. What isn't working with Mr J's link statement?

Nick

Nightfire
03-01-2003, 02:07 AM
You can't do that at all with css. With PHP you can put the applet on a separate page and include it on the pages you want to, but that's about it.

Mr J
03-01-2003, 10:35 AM
Maybe the document.write method will do it

You could place the code in a .js file and run it onload

meow
03-01-2003, 10:44 AM
Me finks excaliber means SSI, not CSS. :)

<!--#include virtual="/path/to/file.inc" -->

Your server needs to support SSI and you may or may not have to rename your HTML docs to .shtml.

PHP can do includes too.

excaliber
03-01-2003, 11:17 AM
Ok
My server supports SSI, what can I do from here to get the end rtesult. Please advise. javascript:smilie(':)')
smile

meow
03-01-2003, 01:09 PM
Me will advice. :p

OK, you cut a piece out like if you were using a pair of scissors. :D

Save the part you want to include to a text file. You can name it bla.txt if you want but .inc is cute and makes you remember what it is. Don't add any extra code to the include bit. It will all be glued together before the browser sees it so you can make the cut anywhere you want to.

Now comes the tricky part. There are two 'commands'.
If you use this the file to be included must be in the same directory as the calling file or in a directory below it.
<!--#include file="bla.inc" -->

If you use this, the inc file can be anywhere but it only accepts root relative paths (from your www or public HTML folder)
<!--#include virtual="/path/to/bla.inc" -->

Just put one of those 'tags' where you want the included stuff to appear.

You will probably have to rename the calling file to *.shtml. You can change that with a .htaccess file if they let you.
Me tired in my typing finger now. :thumbsup:

excaliber
03-01-2003, 01:38 PM
Tks meow
We will work with that. It sounds like it will work. I started thinking SSI gowever I gave little experience with it. Use it on my error pages, but thats it. I'll have to check out more info on it.
By the way I checked out your website. Realy Cool (':thumbsup:')
tks
And thks to every one who has offered help. It is very much appreciated. Not taken lightly. (':cool:')

meow
03-01-2003, 01:44 PM
Thank you, but it isn't my site. It's papa penguin's. :D