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.
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).
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
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.
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.