[Radiant] External javascripts, stylesheets, etc.

Sean Cribbs seancribbs at gmail.com
Wed Aug 16 10:35:48 CDT 2006


Mike,

Not exactly.  Another layout or page would need to refer to the Radiant page
(CSS, Javascript) by its URL for it to be used.

The real reason they need a layout is to set the content-type.  Other than
that, it makes good sense to just dump the content of the page when it's CSS
or Javascript, unless you're doing something programmatic (i.e. Radius tags)
in them.

So, to create your own text-based assets in Radiant, you would simply enter
the content of the file, assign it the Stylesheet or Javascript layout
template, take note of the "slug" (click "more" near the title) and
construct the appropriate URL to the asset based on its slug, parent slugs
and root URL path of your application.  Then you can use that path/URL in
your layouts, snippets, or other pages.

Hope this helps!

Sean Cribbs
seancribbs.com

On 8/16/06, Michael Moscow <mike at mikemoscow.com> wrote:
>
> Hi, folks. I have another question which I realize must be painfully
> obvious to most of you. I'm still confused about a few things.
>
> On the default radiant layout. Within the admin, on the 'Pages' tab
> there is a page called 'styles' which contains all the css for the
> site. This 'styles' page has a layout option called stylesheet. When
> I go to the layouts tab there is a layout named 'stylesheets'  that
> only contains <r:content />
>
> What is the process? Does radiant automatically create the css from
> the 'page' file and stick it in the public/stylesheets directory? Or
> does it embed them into the outputted xhtml?
>
> If I  create a 'layout' named "javascripts" and then I create a
> 'page' with javascript in it and the layout option 'javascripts' will
> radiant automatically create my javascript file and place it  in the
> javascripts folder?
>
> My goal is to have all javascript and css external from the xhtml.
> Would I be better off just creating my own 'css' & 'scripts' folders
> within the public directory and just referencing them from snippets
> and layouts as I would with images?
>
> thanks,
> mike
>
> _______________________________________________
> Radiant mailing list
> Radiant at lists.radiantcms.org
> http://lists.radiantcms.org/mailman/listinfo/radiant
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.radiantcms.org/pipermail/radiant/attachments/20060816/650eb406/attachment.html


More information about the Radiant mailing list