Sorry I can't answer your question directly, but as an alternative you might
consider applying the alternating classes to list elements using javascript.
Some of the appeal in offering Textile or markdown for content editors is
that they have a simple syntax to learn, e.g. asterisks create bullet lists.
As soon as you say to your editors "You have to add a class name in brackets
after the asterisk (but make sure there is no space between the asterisk and
the opening bracket!)", you've lost the simplicity of textile. It would be
preferable to keep the textile code simple, and apply the classes
unobtrusively with javascript.

The following snippet of jQuery would do the trick:

$(document).ready(function() {
  $("#content ul li:nth-child(3n+1)").addClass("one");
  $("#content ul li:nth-child(3n+2)").addClass("two");
  $("#content ul li:nth-child(3n)").addClass("three");

This assumes that the user-editable content is inside a
<div id="content"></div> block, so you may have to tweak it to fit your

I used this technique to apply alternate bullet point styles to the <li> on
this site:

[See the list at the bottom of the page]

Hope this helps!


On Thu, Oct 15, 2009 at 10:53 PM, Nate Turnage <> wrote:

> I am trying to style a list item in a footer snippet and it is not working,
> so I decided to try loading the redcloth extension. And now I am getting an
> error about an unitialized constant in the redcloth_extension. Is the
> redcloth extension still useful for 0.8.1?
> This is what I am trying to do:
> *(class1) List Item One
> *(class2) List Item Two
> *(class3) List Item Three
> But instead of rendering this:
> <ul>
> <li class="class1">List Item One</li>
> <li class="class2">List Item Two</li>
> <li class="class3">List Item Three</li>
> </ul>
> It renders this:
> <p>
> *(class1) List Item One<br>
> *(class2) List Item Two<br>
> *(class3) List Item Three
> </p>
> Styling list items this way works on the Redcloth website:
> Should I report this as a bug somewhere?
> ~Nate
> _______________________________________________
> Radiant mailing list
> Post:
> Search:
> Site:
Radiant mailing list

Reply via email to