Forum: Radiant CMS Radiant and Relative Path Plugin?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
918d6d59d166429f4c00dbb6c0277f76?d=identicon&s=25 Chris Dorner (Guest)
on 2007-01-24 17:04
(Received via mailing list)
Hi there,

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

Regards,
 Christof
6ec6f77ea603dd75b3a7a7775b059e79?d=identicon&s=25 John W. Long (Guest)
on 2007-01-24 17:25
(Received via mailing list)
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 Long
http://wiseheartdesign.com
918d6d59d166429f4c00dbb6c0277f76?d=identicon&s=25 Chris Dorner (Guest)
on 2007-01-24 22:40
(Received via mailing list)
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.
1c1e3bdfe006a22214102fcd6434a012?d=identicon&s=25 Daniel Sheppard (Guest)
on 2007-01-25 00:40
(Received via mailing list)
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: radiant-bounces@lists.radiantcms.org
[mailto:radiant-bounces@lists.radiantcms.org] On Behalf Of Chris Dorner
  Sent: Thursday, 25 January 2007 8:39 AM
  To: radiant@lists.radiantcms.org
  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.
This topic is locked and can not be replied to.