[Radiant] Help on Extension: EmbedPage

Sean Cribbs seancribbs at gmail.com
Thu Mar 8 14:34:06 CST 2007


Colin,

You might be better off with an IFRAME or something similar, otherwise 
you will have to create a bunch of workarounds in your Rails application 
to deal with a different HTTP_REFERER.

The other option, of course, is to fuse Radiant with your application, 
i.e. making your application into an extension, but that may not be 
appropriate.

Sean

Colin Nederkoorn wrote:
> Im building an extension to embed another RoR app in Radiant. I 
> followed the instructions at - 
> http://dev.radiantcms.org/radiant/wiki/HowToWriteAnExtension 
> <http://dev.radiantcms.org/radiant/wiki/HowToWriteAnExtension> to 
> generate the skeleton called M7Embed
>
> The main file is: embed_extension.rb
> --
> class M7embedExtension < Radiant::Extension
>   version "1.0"
>   description "Allows you to embed other sites in Radiant"
>   url ""
>  
>   def activate
>      EmbedPage
>   end
>  
>   def deactivate
>   end
>    
> end
> --
> and a model embed_page.rb:
> ---
>
> class EmbedPage < Page
>   tag 'embed_page' do |tag|
>     require 'open-uri'
>   
>     open(tag.attr['url']).read
>   end
> end
> ---
>
> The issue I am running into is that generally the application I am 
> trying to load has relative references, and when it is embedded, it 
> assumes everything is coming from the embedding page, and not the 
> application... can anyone suggest how to remedy this?
>
> As an example of this code embedding google - 
> http://beta.method-seven.com/embed
>
> Thanks in advance for your help,
>
> Colin
>
> P.s. - Credit to Joannou Ng for submitting a behavior to this list on 
> Jan 18th that was used as the basis for this extension.
> ------------------------------------------------------------------------
>
> _______________________________________________
> Radiant mailing list
> Post:   Radiant at lists.radiantcms.org
> Search: http://radiantcms.org/mailing-list/search/
> Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.radiantcms.org/pipermail/radiant/attachments/20070308/13578e4c/attachment.html


More information about the Radiant mailing list