[Radiant] how do I regex the output of a tag?

Oli Studholme radiantcms.org at boblet.net
Tue Apr 29 21:41:09 CDT 2008


Hi All,

I want to manipulate the contents of <r:url /> using regex. I'm
wanting to do something like MovableType's regex modifier for
variables[1]:
In MT-ese what I want to do is:
    <mt:var tag="pagepermalink" regex_replace="/^(.+)\/ja\/(.*)/","$1/en/$2" />
To change eg:
    http://example.site/ja/optional/path
into:
    http://example.site/en/optional/path

How would I do this? Is there a way to write ruby code directly into
templates? Or am I looking at a custom Radius tag or making an
extension?

Thanks in advance!

peace - oli

[1] http://www.movabletype.org/documentation/appendices/modifiers/regex-replace.html


More information about the Radiant mailing list