Radiant in a subdirectory

I have Radiant installed in a subdirectory, not the site root. I have
set
AbstractRequest.relative_url_root accordingly, which makes admin section
work. Surprisingly, links generated by Radius tags on the site itself
start
from root ("/") and don’t get relative_url_root prepended to them… is
having the application in a subdirectory unsupported? Did anybody have
success setting it up like this?

I’ve searched the archives and the web but it seems there never was a
discussion about not having the app in site root.

Thanks

Also make sure that you uncomment the line that starts “RewriteBase” in
your
public/.htaccess file and fill in the appropriate directory (if you’re
using
Apache).

Sean

On 19/09/06, Mislav MarohniÄ? [email protected] wrote:

I have Radiant installed in a subdirectory, not the site root.

It would be great if you could document this on the wiki!

I’ve set up a link on the HowTo page and made the inital content:

http://dev.radiantcms.org/radiant/wiki/HowToInstallInASubdirectory


Regards,
Dave

Mislav MarohniÄ? wrote:

I have Radiant installed in a subdirectory, not the site root. I have set
AbstractRequest.relative_url_root accordingly, which makes admin section
work. Surprisingly, links generated by Radius tags on the site itself start
from root ("/") and don’t get relative_url_root prepended to them… is
having the application in a subdirectory unsupported?

There’s no support for this out of the box, but you could create a
behavior and assign it to the site root that would probably do what you
need. Something like this:

class RootBehavior < Behavior::Base

 register "Root"

 def page_url
   if parent_behavior?
     clean_url(parent_behavior.child_url(@page))
   else
     clean_url("/subfolder/#{@page.slug}")
   end
 end

end


John L.
http://wiseheartdesign.com

On Sep 19, 2006, at 11:22 PM, John W. Long wrote:

There’s no support for this out of the box, but you could create a
behavior and assign it to the site root that would probably do what
you
need. Something like this:

Or if you want the really easy way out, you could create a parent
page for your radiant root page and give it the same slug as the
radiant directory.

eg for http://my.site/cms

go from:

  • Home (/home)
    |-- About (/home/about)

    etc…

to:

  • Subdir (/cms)
    |- Home (/cms/home)
    |-- About (/cms/home/about)

But I recommend John’s suggestion!

Bodhi

Bodhi wrote:

Or if you want the really easy way out, you could create a parent
page for your radiant root page and give it the same slug as the
radiant directory.

Wow. That’s probably the easiest method by far. Out of curiosity Mislav,
why do you want to put Radiant in another sub directory? Because of the
way the rewrite rules are written, Radiant doesn’t serve content when a
file already exists in the public directory. So if you wanted to put
your own files in the public dir it would use those instead of relying
on Radiant for the content. You could also change the rewrite rules so
that Radiant only serves content from a certain subdirectory and the
/admin/ folder.


John L.
http://wiseheartdesign.com

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs