E Commerce as Behavior?


#1

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

#2

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


#3

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


#4

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


#5

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