Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Calling style sheets

Quote Reply
Calling style sheets
The style sheets for my site lives in a different directory from LinksSQL. I would like to call them into my LinksSQL templates though. Is there and easy tag to do so without hard-coding the path to the style sheets in all my templates. A global maybe?

I know I can duplicate my style sheet file in my LinksSQL directory and use <%include stylesheets.txt%> but that defeats the purpose of the exercise in my opinion. Would like to be able to control the site look-n-feel from a single style sheet. Thanks!

Safe swoops
Sangiro

Last edited by:

sangiro: Feb 8, 2002, 6:41 AM
Quote Reply
Re: [sangiro] Calling style sheets In reply to
*Paul puts on fireproof helmet.....*

>>Is there and easy tag to do so without hard-coding the path to the style sheets in all my templates. A global maybe?<<

You could create a new global that includes the url or relative path to the CSS then use:

<link rel=stylesheet href="<%CSS_TAG%>" type="text/css" title="style sheet">
Quote Reply
Re: [RedRum] Calling style sheets In reply to
In Reply To:
*Paul puts on fireproof helmet.....*


Funny! I live in London now, when the weather gets better I'll take you skydiving! Sly

Thanks! Ok - that should work for style sheets, how about including any other file anywhere else in the template? I have 3 installations of LinksSQL. All their footer files are the same. Instead of placing a footer.txt file in three different directories I'd like to place it in one directory on my server and grab it from there for every Links installation.... Basically mimicking an SSI call.

Safe swoops
Sangiro
Quote Reply
Re: [sangiro] Calling style sheets In reply to
>>when the weather gets better I'll take you skydiving! <<

I bet you'd give me a faulty parachute Cool

>>Instead of placing a footer.txt file in three different directories I'd like to place it in one directory on my server and grab it from there for every Links installation<<

I belive Links SQL lets you use relative paths in includes so you can use:

<%include /path/to/footer.txt%>

...in each template. I think the /path/ begins at your document root.
Quote Reply
Re: [RedRum] Calling style sheets In reply to
In Reply To:

I belive Links SQL lets you use relative paths in includes so you can use:

<%include /path/to/footer.txt%>

...in each template. I think the /path/ begins at your document root.
Yup, but remember I said I don't want to hard-code any paths in my templates.... Smile

Safe swoops
Sangiro
Quote Reply
Re: [sangiro] Calling style sheets In reply to
>>Yup, but remember I said I don't want to hard-code any paths in my templates....
<<

Another global?

'footer' => 'sub {

open T, "/path/to/footer.txt" or die "Can't read footer : $!";
read T, my $str, -s T;
close T;

return $str;

}'

Last edited by:

RedRum: Feb 8, 2002, 8:42 AM
Quote Reply
Re: [sangiro] Calling style sheets In reply to
You could also do relative paths I think:

<%include ../../footer.txt%>

Remember that the directory starts in admin/templates/default, so you back up from there. Alternatively, you can just symlink the files, ie:

cd /path/to/admin/templates/default
ln -s /path/to/real/footer.txt footer.txt

and then just do <%include footer.txt%>.

Cheers,

Alex
--
Gossamer Threads Inc.
Post deleted by RedRum In reply to

Last edited by:

RedRum: Feb 8, 2002, 9:38 AM