Radiant and Relative Path Plugin?


#1

Hi there,

I wanted to ask if it’s possible to run Radiant with the Relative Path
Plugin?

Regards,
Christof


#2

Chris Dorner wrote:

I wanted to ask if it’s possible to run Radiant with the Relative Path
Plugin?

I’m not familiar with that plugin. What is it that you are trying to do?


John L.
http://wiseheartdesign.com


#3

The admin pages should work with the relative path plugin, but the
actual site itself might be an issue because it doesn’t actually use
url_for, which is what the relative path plugin hooks into. Oh, and by
the way, you’d be using a ReverseProxy directive in apache, not an
Alias.

The problem that you’ll have is that the Page#url method is used
everywhere for both the rendering of links to the user and also the
matching of urls. You want to match against /articles/monkeys-are-great,
but render /radiant/articles-are-great.

The simplest approach would probably be to set up two ProxyPass
statements in apache:

ProxyPass /radiant/admin/ http://localhost:3000/admin/
ProxyPassReverse /radiant/admin/ http://localhost:3000/admin/

ProxyPass /radiant/ http://localhost:3000/radiant/
ProxyPassReverse /radiant/ http://localhost:3000/radiant/

And then create a parent /radiant/ page in radiant and make everything a
child of that.

Otherwise, you might be able to make it work with:

class Page
def url
if parent?
parent.child_url(self)
else
clean_url("/radiant/#{slug}")
end
end
end

class SiteController
def show_page
response.headers.delete(‘Cache-Control’)
url = “/radiant/#{params[:url].to_s}”
if live? and (@cache.response_cached?(url))
@cache.update_response(url, response)
@performed_render = true
else
show_uncached_page(url)
end
end
end


From: removed_email_address@domain.invalid
[mailto:removed_email_address@domain.invalid] On Behalf Of Chris Dorner
Sent: Thursday, 25 January 2007 8:39 AM
To: removed_email_address@domain.invalid
Subject: Re: [Radiant] Radiant and Relative Path Plugin?

I made an Alias on Apache (server.com/radiant/) which redirects
the request to the mongrel server, but Rails has just absolute links
(i.e. server.com/admin/pages ) but it should be rendered as
server.com/radiant/admin/pages.


#4

I made an Alias on Apache (server.com/radiant/) which redirects the
request
to the mongrel server, but Rails has just absolute links (i.e.
server.com/admin/pages) but it should be rendered as
server.com/radiant/admin/pages.