A note on dwoo

A note on dwoo, a forum discussion on Jojo CMS. Join us for more discussions on A note on dwoo on our Plugin Support forum.

Back to Forum Index : Back to Plugin Support   RSS
Rick Rick

11 Sep 2009
Posts: 336

Just a quick note on the new Dwoo templating engine... it seems to be fussy about when you assign vars... Eg you can't assign vars using hooks from within templates anymore.

This was very useful to keep the overhead down when some things were only done on certain pages.

Just putting this up as a handy note for others, I wasted too much time on this today.
Jaijaz Jaijaz

14 Sep 2009
Posts: 215

Thanks Rick.

I was just wondering with dwoo, do you need to use a whole different assign method in your code or does $smarty->assign send it through exactly the same?
If you not living on the edge you taking up too much space.
mikec

Lead Developer

mikec

14 Sep 2009
Posts: 67

In Jojo 1 it's still just the same. Dwoo has a Smarty compatibility layer that emulates Smarty pretty well.
http://wiki.dwoo.org/index.php/SmartySupport

We'll be doing something a bit different in Jojo2 - yet to be determined, but something around making the template engine pluggable so you can use a different one in your plugins if you want.
Rick Rick

14 Sep 2009
Posts: 336

Jaijaz: You're fine, $smarty->assign works just fine... but I was using a method where my template would call a hook that would then use $smarty->assign to set some info. Though I kept running into situations where it couldn't be used immediately (when using Dwoo, not Smarty).

mikec: No worries, I'm very impressed with how well that compatibility layer fares (particularly using 'assign' on includes). The only snag I'd hit was with adding more assigned values after rendering had begun. Unless it was something else of mine that was messing it up.

Jojo2? I'm curious I just hope you don't swap out the filters and hooks for something more like Wordpress or Drupal... I like being able to specify priority :)
Rick Rick

15 Sep 2009
Posts: 336

In regards to being able to use different pluggable template engines for different plugins, that sounds great. But would that mean that if you want to override a plugin template with one in the theme folder then it has to use the same template engine as the original plugin? Even so, it sounds like a nifty feature.
Back to Forum Index : Back to Plugin Support   RSS
You must be logged in to post a reply



You need to Register or Log In before posting on these forums.