# How to add css styles to a website?

**URL:** <https://www.ruby-forum.com/t/how-to-add-css-styles-to-a-website/69431>\
**Category:** Radiant CMS\
**Created:** [September 20, 2006, 11:44pm UTC](https://www.ruby-forum.com/t/how-to-add-css-styles-to-a-website/69431 "2006-09-20T23:44:07Z")\
**Posts on this page:** 10\
**Page:** 2

<div class="post-metadata">

**Author:** ![Tino\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a183cd/32.png) [@Tino\_B](https://www.ruby-forum.com/u/Tino_B)\
**Post date:** [September 22, 2006, 5:51pm UTC](https://www.ruby-forum.com/t/how-to-add-css-styles-to-a-website/69431/21 "2006-09-22T17:51:45Z")

</div>

On 9/22/06, John W. Long [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I’d appreciate a patch that addressed these issues.

Deal! I kinda fell in love with Radiant in the past few days (evaluating  
it)  
so it will be a pleasure.

Be patient, because I’m still studying hard for college. A week from now  
and  
I’ll get to it.

---

<div class="post-metadata">

**Author:** ![Tino\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a183cd/32.png) [@Tino\_B](https://www.ruby-forum.com/u/Tino_B)\
**Post date:** [September 22, 2006, 2:55pm UTC](https://www.ruby-forum.com/t/how-to-add-css-styles-to-a-website/69431/22 "2006-09-22T14:55:10Z")

</div>

On 22/09/06, Keith B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I need to build a small archive, but not really a date based one. I  
> just need to show 5 Articles at a time, then the next five. I assume  
> a behavior would do this, but actually at the moment have no idea how  
> to start. Any tips and prods in the right direction appreciated.

I’m not sure how to automatically increment the offset, but this would  
be kinda what’s needed:

\<r:children:each offset=“0” limit=“5” by=“name” order=“asc”\>

–  
Regards,  
Dave

---

<div class="post-metadata">

**Author:** ![Tino\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a183cd/32.png) [@Tino\_B](https://www.ruby-forum.com/u/Tino_B)\
**Post date:** [September 24, 2006, 11:06pm UTC](https://www.ruby-forum.com/t/how-to-add-css-styles-to-a-website/69431/23 "2006-09-24T23:06:40Z")

</div>

2006/9/20, John W. Long [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> It’s probably better to create a layout with a content type of  
> “text/css” and put just the tag \<r:content /\> in the layout. Then create  
> a page, assign the layout, and paste your css in the body part.

Well, i figured out how to apply css to one page, but the children  
won’t use the styles. I just don’t get a site-wide css working with  
the possibilties radiant offers. How it works with a static css file  
is clear to me. Can someone give me a little more help 🙂 ?

Thanks,  
Tino

---

<div class="post-metadata">

**Author:** ![Tino\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a183cd/32.png) [@Tino\_B](https://www.ruby-forum.com/u/Tino_B)\
**Post date:** [September 24, 2006, 11:14pm UTC](https://www.ruby-forum.com/t/how-to-add-css-styles-to-a-website/69431/24 "2006-09-24T23:14:42Z")

</div>

On 9/24/06, Tino B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 2006/9/20, John W. Long [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):
> 
> > It’s probably better to create a layout with a content type of  
> > “text/css” and put just the tag \<r:content /\> in the layout. Then create  
> > a page, assign the layout, and paste your css in the body part.
> 
> Well, i figured out how to apply css to one page, but the children  
> won’t use the styles. I just don’t get a site-wide css working with  
> the possibilties radiant offers. How it works with a static css file  
> is clear to me. Can someone give me a little more help 🙂 ?

Create a temporary Radiant instance and when you run script/setup\_db  
select option 3 (styled blog). This seems to do what you are asking  
for.

HTH,  
Tom

---

<div class="post-metadata">

**Author:** ![Tino\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a183cd/32.png) [@Tino\_B](https://www.ruby-forum.com/u/Tino_B)\
**Post date:** [September 25, 2006, 9:13am UTC](https://www.ruby-forum.com/t/how-to-add-css-styles-to-a-website/69431/25 "2006-09-25T09:13:34Z")

</div>

> Create a temporary Radiant instance and when you run script/setup\_db  
> select option 3 (styled blog). This seems to do what you are asking  
> for.

Ah, now i have understood the flow. Thanks.

Tino

---

<div class="post-metadata">

**Author:** ![Tino\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a183cd/32.png) [@Tino\_B](https://www.ruby-forum.com/u/Tino_B)\
**Post date:** [September 25, 2006, 2:50pm UTC](https://www.ruby-forum.com/t/how-to-add-css-styles-to-a-website/69431/26 "2006-09-25T14:50:16Z")

</div>

To avoid having stylesheets in my sitemaps, I create a page part named  
“no-map”. Then I do \<r:children:each\>\<r:unless  
part=“no-map”\>\</r:unless\>\</r:children\>

2006/9/25, Steven N. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![Tino\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a183cd/32.png) [@Tino\_B](https://www.ruby-forum.com/u/Tino_B)\
**Post date:** [September 25, 2006, 10:09am UTC](https://www.ruby-forum.com/t/how-to-add-css-styles-to-a-website/69431/27 "2006-09-25T10:09:38Z")

</div>

On 20 Sep 2006, at 23:54, John W. Long wrote:

> On the Ruby site we put the stylesheets in public/stylesheets.

Given the difficulty of keeping the stylesheet out of the navigation  
(when working with r:children:each) if you put your CSS in the  
database, moving the stylesheet out of Radiant seems like the best  
practice to me, no? Or we should have some sort of fifth status  
option: draft/review/published/hidden/hiddenfromnav. What’s the  
meaning of the current ‘hidden’, BTW?

-- Steven N. http://outerthought.org/ Outerthought Open Source Java & XML stevenn at outerthought.org stevenn at apache.org

---

<div class="post-metadata">

**Author:** ![Tino\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a183cd/32.png) [@Tino\_B](https://www.ruby-forum.com/u/Tino_B)\
**Post date:** [September 25, 2006, 3:08pm UTC](https://www.ruby-forum.com/t/how-to-add-css-styles-to-a-website/69431/28 "2006-09-25T15:08:18Z")

</div>

On 9/25/06, Steven N. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> … we should have some sort of fifth status  
> option: draft/review/published/hidden/hiddenfromnav. What’s the  
> meaning of the current ‘hidden’, BTW?

I agree we should have a status of “special” or something like that for  
stylesheets and content that would not be included by default in  
eachlistings and similar.

Not every content is going to be a regular page.

Giovanni, having that would save you a “no-map” hack 🙂

-M

---

<div class="post-metadata">

**Author:** ![Tino\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a183cd/32.png) [@Tino\_B](https://www.ruby-forum.com/u/Tino_B)\
**Post date:** [September 25, 2006, 9:04pm UTC](https://www.ruby-forum.com/t/how-to-add-css-styles-to-a-website/69431/29 "2006-09-25T21:04:48Z")

</div>

I know that something like that would save a hack, but I’m starting to  
think  
that page parts should be naturally used to describe attributes of the  
page.

2006/9/25, Mislav MarohniÄ? [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![Tino\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a183cd/32.png) [@Tino\_B](https://www.ruby-forum.com/u/Tino_B)\
**Post date:** [September 25, 2006, 9:26pm UTC](https://www.ruby-forum.com/t/how-to-add-css-styles-to-a-website/69431/30 "2006-09-25T21:26:51Z")

</div>

On 9/25/06, Giovanni I. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I know that something like that would save a hack, but I’m starting to  
> think that page parts should be naturally used to describe attributes of the  
> page.

Funny. I always thought that page parts should be naturally used to hold  
parts of the page.

What next, you will need revision date attribute besides published date  
and  
you will start creating page parts everywhere holding a timestamp and  
being  
named ‘revision date’?

[Previous page](https://www.ruby-forum.com/t/how-to-add-css-styles-to-a-website/69431.md?page=1)
