This is a great alternative to messy iframes...

Have you considered making this an extension, to easily add the tag,  
and possibly a GUI to manage external pages, so they can be handled  
by a name or other identifier, with the record keeping track of URL  
and query parameters?


On Jul 4, 2007, at 1:26 AM, Francesco Lunelli wrote:

> Some time ago I used this method to include static html pages in a  
> Radiant site without using iframes. This method is far from to be  
> cmplete, there are many improvements, adn I hope I will have time  
> to do them, but it works. The biggest problem to resolve is the  
> redirection of inner links. I am working on this using apricot, but  
> this part is not complete. I hope I will be able to complete it soon.
> If you need more feel free to ask me.
>
> The possibility of capturing query parameters is not limited to
> addressing different part of pages, but it could be useful in many  
> ways,
> I hope this possibility will be included in standard radiant  
> distribution.
> In this case I used it to include static html pages into radiant
> generated pages.
> I have a customer that decided one of his emplyee MUST do some pages
> using an editor like nvu. (Learning to use radiant cms is too  
> difficult
> for her)
> But the rest of the site is generated from radiant, menu and pages  
> etc.
> For the moment the tag is customised to my needs, but I think it could
> be easily modified to any needs.
> First of all I modified the site_controller.rb according to this post
> http://lists.radiantcms.org/pipermail/radiant/2007-February/ 
> 003480.html
>
> Then I created a custom tag
>
> ...
>   require 'net/http'
>   require 'uri'
>
>   tag 'inner_site' do |tag|
>
> # site is the url of the site I want to include risposta is the html
> page I will get back
>
>     site = tag.attr['site']
>     risposta=""
>
> # this is the radiant pag with "inner_site" tag for example
> http://www.mysite.org/including
> # the page "including" shoud be simply <r:inner_site
> site="http://radiantcms.org"; />
>
>     server=request.env['PATH_INFO']
>
> # this caputures the query string parameter (it should be made better
> capturing all parameters in a hash with name and value, bu for the
> moment it woks) The var @pagina contains the stati html page I want to
> include. i.e /html/iniziative.html
>
>     tag.globals.page.request.params.each do | param |
>       @pagina = param[1].to_s.dup
>     end
>     if site
>       url = URI.parse(site)
>       res = Net::HTTP.start(url.host, url.port) {|http|
>         @pagina ? http.get(@pagina) : http.get("/html/ 
> iniziative.html")
>       }
> # here I replace every internal link with a link to the radiant page
> adding in the url the query string for the new page
> #external links (those starting with http://) are leaved unchanged
> # this part need a lot of work to be useful in every situation (pages
> made with mac osx have different new line charachter, there should  
> be a
> better way to control if the link is internal or external) but form my
> needs work enought.
> # images and css paths are unchanged, so you will not see images  
> and css
> formatting
>       res.body.each_line {|line|
>         risposta+=  line=~/http/ ? line :
> line.gsub(/href="(.*)"/,"href=\"#{server}?pag="+'\1"')
>       }
>     end
>     risposta
>   end
>
>
> now you can use this form to include radiant site in your page
> http://www.mysite.org/including?pag=/index
>
>
>
> -- 
> Francesco Lunelli
> Ymir s.r.l.
> Viale Verona 190/11
> 38100 Trento
>
>
> _______________________________________________
> Radiant mailing list
> Post:   Radiant@lists.radiantcms.org
> Search: http://radiantcms.org/mailing-list/search/
> Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

_______________________________________________
Radiant mailing list
Post:   Radiant@lists.radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Reply via email to