Template system thoughts

2 views
Skip to first unread message

Torsten Rüger

unread,
Nov 23, 2009, 2:27:39 PM11/23/09
to spree...@googlegroups.com
So I've read here and there that templates are coming and just wanted
to chip my bit in:

For me the existing extension system is very suited to start writing
templates. It allows easy overriding of sass/images and views, which
is most a template will want to do.
But it's not restricted to that and allows for changing views (erb)
and adding them.
With a little load order definition one can even extend templates.
They can have their own admin interface maybe to change colors.

So all is good, so why am I writing: From previous systems I got the
experience that in the end templates/extension trample on their feet
on the very few lines that it takes to define the main two pages of a
system: product list and product view.

What I mean is, that what is is good, but to make it outstanding
(let's call it the ruby way) it would have to allow for several
extensions/templates to make changes to the _same_ view (erb/sass...).
This is off course an old problem called three (or n-)way merging,
like known to all from source control systems.

Example: My site extension adds categories to the product view. The
recommendations extension adds recommendations to the product view.
Now the recommendations extension doesn't even try to change the
product view, surely because the author foresaw conflict, but lets
say it did:

Then, where spree now just uses the first extensions product view or
copies sass files, it would detect both versions (on startup), merge
and save them into the correct spree directory and henceforth use
that version. If it couldn't merge, it would exit before even starting.

Several merge tool exists in ruby, eg: diff-lcs* and merge3. (*
would have to be used on lines, ie arrays of lines)

Torsten


Sean Schofield

unread,
Nov 23, 2009, 10:09:34 PM11/23/09
to spree...@googlegroups.com
The new theming stuff will allow multiple extensions to adjust the
same view. Its one of the motivations for building such a system.
We're going to have hooks and regions simliar to what WP, Drupal and
other frameworks with themes currently support.

We're making progress. Wynn was stuck on the checkout this week and
we actually paired today and I helped him to get unstuck on a major
issue. So I'm hoping we'll have some more progress to report shortly.
We need it for a client project in December as well so you can count
on us finishing it up soon.

Sean Schofield

-------------------------------------------
Rails Dog LLC
2 Wisconsin Circle, Suite 700
Chevy Chase, MD 20815
voice: (301)560-2000
-------------------------------------------
> --
>
> You received this message because you are subscribed to the Google Groups "Spree" group.
> To post to this group, send email to spree...@googlegroups.com.
> To unsubscribe from this group, send email to spree-user+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/spree-user?hl=.
>
>
>
Reply all
Reply to author
Forward
0 new messages