Jason Broom said the following on 11/13/2009 05:45 PM:
> I'm seeking a clarification on the relationships between Pages, Snippets and
> Layouts when it comes to CSS. I'm unable to visualize how Radiant mashes a
> Page named 'Styles' containing CSS, associates it with a Layout that only
> has the Radiant tag <r:content />, then somehow maps to the div structures
> in the Layout named 'Normal'.
> 
> Is it because the Page 'Styles' is slugged 'styles.css', and the Layout
> 'Stylesheet' is a context-type text/css
> 
> I know this is Radiant 101, but thinking of CSS as a Page is not intuitive,
> as I equate Pages with navigation. Would I be better off skipping CSS as a
> Page, and just <link rel="stylesheet"> somewhere in the metaverse? 
> 
> Just looking for some insights from those with deeper experience.

This, and the SnS extension, are there to allow you to edit the
stylesheet just as you would a page. That's a great boon when
developing!  It also gives you control over the CSS timeout.
Oh,and it has a minifier as well.

Yes, I know, most sites and environments don't let you edit the CSS just
like any other page;that's why its, as you say, 'not intuitive'.  But
its damn useful!

Remember, "there's more than one way to do it".
The shipped example as a layout that you are not forced to use.
There are many freely downloadable as well as pay-for-use layouts.


However ...
Not everything under "pages" has to be a page.  What is displayable is
up to you.   I have many pages in my sites that don't appear on a menu.
The page that has the RSS code is another example.

I have a menu - see the <r:navigation /> tag for an example.
If its not on the menu, its not a 'top level' subject.
I have some 'branches' where the children don't have links from the
parents.  In fact I have one 'branch' that's not in the menu whose
children are just definitions and are all linked to directly.  Think of
it as a 'dictionary'.

I offer this as an example of "a page is what you decide it should be".

Having one or more page that contain CSS or Javascript is great for
development.  Or, for that matter language or context sensitive work.

Another example.  In development mode - see <r:if_dev /> -
or according to specific settings - <r:config:setting /> and <r:if /> -
I may want to use specific CSS, such as outlining the bounding boxes of
graphics (or <div>s) in a thin red line.  Or apply special CSS to pages
that are recent or by certain authors.  All very easy to do with
'dynamic' settings in the Layout.

Why?  Well if your CSS is a page, then it gets rendered. You can put
radius tags in it and have them dynamically evaluated.

You can't do that if its a static file in the file system.

See http://nubyonrails.com/articles/dynamic-css for some more ideas

See also
http://nubyonrails.com/articles/dynamic-css
http://www.artofmission.com/articles/2006/06/06/radiant-cms
http://wiki.github.com/radiant/radiant/elegant-page-level-css


-- 
My Lord, If I attempted to answer the mass of futile correspondence
which surrounds me, I should be debarred from the serious business of
campaigning...So long as I retain an independent position, I shall see
no officer under my command is debarred by attending to the futile
driveling of mere quill-driving from attending to his first duty, which
is and always has been to train the private men under his command that
they may without question beat any force opposed to them in the field. -
Lord Wellington to the Secretary of State for War during the Peninsular
Campaign
_______________________________________________
Radiant mailing list
Post:   [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Reply via email to