Forum: Radiant CMS r:link and hosting multiple sites off a single radiant insta

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Patrick H. (Guest)
on 2007-01-17 07:49
(Received via mailing list)
After reading the suggestion at

I tried setting up just such a system. It largely works; however,
unsurprisingly the r:link tag is thoroughly confused. As radiant does
not know that apache is "rehoming" all of its tags, I get goofed up

If I am missing something and there is an easy way around this
problem, please let me know. If not one thing that is working for me
is this simple patch against r:link, allowing for a "base" option that
is removed from the front of the url.

Thanks for Radiant

Index: /Users/phurley/mental/radiant/app/models/standard_tags.rb
--- /Users/phurley/mental/radiant/app/models/standard_tags.rb  (revision
+++ /Users/phurley/mental/radiant/app/models/standard_tags.rb  (working
@@ -340,10 +340,13 @@
   tag 'link' do |tag|
     options = tag.attr.dup
     anchor = options['anchor'] ? "##{options.delete('anchor')}" : ''
+    base = options['base'] ? options.delete('base') : nil
     attributes = options.inject('') { |s, (k, v)| s <<
%{#{k.downcase}="#{v}" } }.strip
     attributes = " #{attributes}" unless attributes.empty?
     text = tag.double? ? tag.expand : tag.render('title')
-    %{<a href="#{tag.render('url')}#{anchor}"#{attributes}>#{text}</a>}
+    url = tag.render('url')
+    url = url.sub(/^#{base}/,'') if base
+    %{<a href="#{url}#{anchor}"#{attributes}">#{text}</a>}

   desc %{   <r:breadcrumbs [separator="separator_string"] />
This topic is locked and can not be replied to.