[Radiant] Table of contents snippet help
Ruben D. Orduz
aminox at gmail.com
Sun Nov 12 16:07:46 CST 2006
Can you just create a FAQ controller (and behaviour) and have the url encode
the arguments? Even though your solution *works,* it violates DRY....BIG
TIME!
On 11/12/06, Joseph Banks <jbanks at ambitiouslemon.com> wrote:
>
> This is what I came up with. Its not ideal because its less automated
> than I wanted. I have to add an extra if_url section for every category
> I create.
>
> <r:if_url matches="./*faq/$">
> <div id="tableofcontents">
>
> h2. Table of Contents:
>
> <ul id="contentlist">
> <r:children:each>
> <li> "<r:title/>":<r:url/>: (<r:children:count/>)
> </li></r:children:each>
> </ul>
> </div>
>
> </r:if_url>
>
> <r:if_url matches="./*faq/category-1/$">
> <div id="tableofcontents">
>
> h2. Table of Contents:
>
> <ul id="contentlist">
> <li>"<r:title/>":<r:url/>: (<r:children:count/>)
> <ul>
> <r:children:each>
> <li>"<r:title/>":#<r:slug/></li>
> </r:children:each>
> </uL>
> </li>
> <r:parent>
> <r:children:each>
> <r:unless_url matches="./*faq/category-1/$"><li>"<r:title/>":<r:url/>:
> (<r:children:count/>)</li></r:unless_url>
> </r:children:each></ul>
> </r:parent>
> </div>
> </r:if_url>
> <r:if_url matches="./*faq/category-2/$">
> <div id="tableofcontents">
>
> h2. Table of Contents:
>
> <ul id="contentlist">
> <li>"<r:title/>":<r:url/>: (<r:children:count/>)
> <ul>
> <r:children:each>
> <li>"<r:title/>":#<r:slug/></li>
> </r:children:each>
> </uL>
> </li>
> <r:parent>
> <r:children:each>
> <r:unless_url matches="./*faq/category-2/$"><li>"<r:title/>":<r:url/>:
> (<r:children:count/>)</li></r:unless_url>
> </r:children:each></ul>
> </r:parent>
> </div>
> </r:if_url>
> <r:if_url matches="./*faq/category-3/$">
> <div id="tableofcontents">
>
> h2. Table of Contents:
>
> <ul id="contentlist">
> <li>"<r:title/>":<r:url/>: (<r:children:count/>)
> <ul>
> <r:children:each>
> <li>"<r:title/>":#<r:slug/></li>
> </r:children:each>
> </uL>
> </li>
> <r:parent>
> <r:children:each>
> <r:unless_url matches="./*faq/category-3/$"><li>"<r:title/>":<r:url/>:
> (<r:children:count/>)</li></r:unless_url>
> </r:children:each></ul>
> </r:parent>
> </div>
> </r:if_url>
> <r:if_url matches="./*faq/category-4/$">
> <div id="tableofcontents">
>
> h2. Table of Contents:
>
> <ul id="contentlist">
> <li>"<r:title/>":<r:url/>: (<r:children:count/>)
> <ul>
> <r:children:each>
> <li>"<r:title/>":#<r:slug/></li>
> </r:children:each>
> </uL>
> </li>
> <r:parent>
> <r:children:each>
> <r:unless_url matches="./*faq/category-4/$"><li>"<r:title/>":<r:url/>:
> (<r:children:count/>)</li></r:unless_url>
> </r:children:each></ul>
> </r:parent>
> </div>
> </r:if_url>
>
> Any ideas on how to have it automatically cycle through each of the
> categories rather than my having to create it manually?
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Radiant mailing list
> Post: Radiant at lists.radiantcms.org
> Search: http://radiantcms.org/mailing-list/search/
> Site: http://lists.radiantcms.org/mailman/listinfo/radiant
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.radiantcms.org/pipermail/radiant/attachments/20061112/d91adca7/attachment.html
More information about the Radiant
mailing list