Forum: Radiant CMS E Commerce as Behavior?

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.
Matt M. (Guest)
on 2007-01-16 21:18
(Received via mailing list)
Hi,

I posted this earlier but think there may have been a problem. So I hope
this didn't get posted twice!

I'm considering using Radiant for a site, but the site needs a basic
e-commerce package also. Does it seem feasible to integrate e commerce
functionality by using behaviors? If not, how would one go about adding
this
kind of functionality on top of Radiant?

Thanks!

- matt
Todd McGrath (Guest)
on 2007-01-16 21:24
(Received via mailing list)
Quoting "Matt M." <removed_email_address@domain.invalid>:

> Thanks!
>
> - matt
>


Matt,

Shouldn't be a problem, but can't recommend going with behaviors.  Short
answer:
Radiant "mental" branch and extensions (instead of behaviors).  Besides
checking
out mental, you can gain a bunch of insight into extensions by searching
the
mailing list or check the Sean's post on the Weblog link on the Radiant
site.
I believe documentation is on the way.

Hope this helps,
Todd
Joannou Ng (Guest)
on 2007-01-16 23:58
(Received via mailing list)
I'm doing something similar whereby I have a Radiant powered site,
with commerce functionality. My approach was to write an
ExternalContent behavior which allows me to do the following in Radiant:

<r:external_content url="http://another-rails-app.com/products/list" />

The above will then pull in a partial page from another Rails app
which implements the commerce functionality.

The way I look at it, Radiant is great for content management. But
extending Radiant from within to do anything other than content
management seems inelegant to me. Instead, coding your Rails app
externally allows you to do anything, and at the same time, provide
content to Radiant.

Cheers, Joannou.

He who knows best knows how little he knows. - Thomas Jefferson
Luigi R. (Guest)
on 2007-01-17 00:25
(Received via mailing list)
Joannou Ng wrote:
> I'm doing something similar whereby I have a Radiant powered site, with
> commerce functionality. My approach was to write an ExternalContent
> behavior which allows me to do the following in Radiant:
>
> <r:external_content url="http://another-rails-app.com/products/list" />

Hello Joannou. It seems to me a practical and effective approach.
Wouldn't you mind to share the code of the tag? Many thanks in advance.
L
Joannou Ng (Guest)
on 2007-01-19 17:31
(Received via mailing list)
Very straightforward.

Create a new file, external_content_behavior.rb, in app/behaviors,
with the following content:

class ExternalContentBehavior < Behavior::Base
   register 'External Content'
   description 'Get and render external content.'

   define_tags do
     tag 'external_content' do |tag|
       require 'open-uri'

       open(tag.attr['url']).read
     end
   end
end

Cheers, Joannou.

Hope is not a strategy. - Michael Henos
This topic is locked and can not be replied to.