[Radiant] Simple blog too complex: what does this code do?

Mislav Marohnić mislav.marohnic at gmail.com
Thu Mar 8 04:07:12 CST 2007


On 3/8/07, Martin Olsson <martin at smpl.se> wrote:
>
> There is one piece of code in the "Normal" layout that I
> don't quite understand:
>
> <r:if_url matches="^/articles/\d{4}/\d{2}/\d{2}/.+"><r:unless_url
> matches="-archives/$"><p class="info">Posted by <r:author /> on
> <r:date /></p></r:unless_url></r:if_url>


It's simple really - you read it out like English :)

If the current URL starts with "/articles/YYYY/MM/DD" (generic blog format),
print out "Posted by [author] on [date]" in a paragraph. However, the URL
must not end in "-archives/". This is because archives are pages with that
URL format, too, but you don't want them to look like blog posts.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.radiantcms.org/pipermail/radiant/attachments/20070308/b02b655f/attachment.html


More information about the Radiant mailing list