I see that Casper already sent a reply but I thought I'd mention the Styles 'n Scripts extension here since it was made to make things like this simpler. You would simply use the <r:stylesheet> or <r:javascript> tag in your Page/Layout/Snippet to render the thing you want:

<r:stylesheet name="my_stylesheet.css" as="link" />
<link rel="stylesheet" href="/css/my_stylesheet.css" type="text/css" />

<r:stylesheet name="my_stylesheet.css" as="url" />

Of course the /css directory in the examples is the extension's default but you can change that to whatever you want.

You can also use these tags to pull the content from a stylesheet of javascript into your document's <head> section.


John and Catherine Allen wrote:
This has to be a really basic question, but despite reading the documentation and many mailing list posts, I still don't get it...

For stylesheets which are stored in the database
1) In a layout, what is the recommended way to refer to a stylesheet ?
2) In a page, what is the recommended way to refer to a stylesheet ?

My stylesheets work fine when I refer to them as files in the filesystem, but not when they are in the database.


Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Reply via email to