Ruby Forum Radiant CMS > How to use regex with if_url tag!

Posted by Arik Jones (imakethings)
on 04.05.2008 14:53
<r:if_url matches="^.*\b(podcast|podcasts|audio|media)\b.*$">

### some reference to an audio file here ###

</r:if_url>

Essentially what the regular expression above does is show the content
only if the url contains any of the following words. So in the example
if I'm running a podcast (using page_attachments to upload audio files)
I can show the audio url ONLY within the context of the url keywords
described in the regexp and you can add as many keywords as you'd like.
Posted by Sean Cribbs (seancribbs)
on 04.05.2008 17:24
(Received via mailing list)
Arik,

Nice tip!  You can do some pretty powerful things with <r:if_url> and
regexps.

Sean