January 25, 2010

a logo

Tags: ,
Filed under: ZenMagick — DerManoMann @ 10:51 am

Today is one of the rare occasions where I will include an image in one of my posts. Unfortunately, there isn’t that much opportunity to do so more often, but I have this inkling there will be more to come.

The reason is that Matt from malevolent.com took some spare time and created one! Thanks a lot!

It might not be to everybody’s liking, but I like it. So, here it is:

The other good news is that we’ll soon have a redesigned website to go with that logo! Who knows, we might even have ZenMagick T-Shirts soon if we aren’t careful :)

Once the new design is up we can also tackle creating integrated themes/skins for the wiki and forum. That should be fun and I am sure the result will be a much more usable system. Ultimately, that will hopefully also lead to more useful contents :)

May 26, 2009

themes!

Tags: , , , , , , ,
Filed under: ZenMagick — DerManoMann @ 6:36 am

I just realized that the wiki still claims that there aren’t any themes available for ZenMagick. That is, of course, not true!

I’ve updated the wiki’s theme repository page with some information and links to the demo store for each theme. Seing that themes/templates are a popular search topic, I hope that this helps spread the word…

May 25, 2009

The ZenMagick templating API

Tags: , , , , ,
Filed under: ZenMagick — DerManoMann @ 1:01 am

Introduction

In ZenMagick, templates (single files) are organized in themes. There is not a complete fancy templating engine, but I’ve tried to concentrate all code used by templates as much as possible and allow for easy extension and customization.

With the exception of i10n and l18n code, all actual PHP code is kept in the toolbox. The toolbox is available in all templates and is the central place for template code in ZenMagick.

Toolbox

The toolbox is a single class that acts as container for a number of utility classes that provide (static) methods to make templating easier.

As can be seen from the documentation, right now there are 6 different tools in the box: form, html, locale (not complete), macro, net and utils.

Each covers a certain area of functions, for example, the net tool provides a range of methods to generate store URLs.

Templates can either use the convenience variables $from, $html, etc… or use the central object $toolbox.

Example:

$net->url(FILENAME_PRODUCT_INFO');

Customization

As with most classes, toolbox items may be customized by providing alternative implementation classes (without the ZM prefix).

It is also possible to add new elements to the toolbox with something like:

ZMToolbox::instance()->set('foo', new MyFooTool());

The above would result in a variable $foo being available in all templating (including emails, popups, whatever) and also via $toolbox->foo.

Outlook

There are more toolbox tools in planning, in particular a separate tool for admin pages and perhaps one for plugins.

April 2, 2009

things to come

Tags: , , , , , , ,
Filed under: ZenMagick — DerManoMann @ 9:46 pm

Even though it will be some more time before the next release I’d like to write a bit about what is going to hit the shelfes in the future.

Form Handling

As already mentioned, there are going to be some major(ish) changes to templates. More specifically, fomrs and form fields. Due to the fact that form submissions [except for the checkout] are handled by ZenMagick code, it’s now safe to change the names of form fields.

Why would we do that? Well, getting the form field names and the property names of the model objects feeding them in line seems like a good idea. It also makes it a lot easier to move form handling onto the next level of using generic code rather than specific code for each form.

This change has had more severe consequences than I expected, though. For one thing, form validation changed a bit and a lot of controller that now take advantage of the new code.

Another area is url mappings. All build in forms that ZenMagick handles are now configured as part of the url mappings. That means that controller do not need to create, populate and validate form objects themselfes, but can rely on the fact that processGet() and processPost() are only called if the form validation (if configured) was successful. All that is left, is to call $this->getFormBean() to retreive an object containing all relevant form data.

One particular improvement in that context that I was looking forward to, was that now the state (text input) and zoneId (dropdown) are now properly separate fields which makes some things a lot easier during processing. No more guessing as to what the actual content is.

Toobox

There are more changes/additions to the toolbox to further centralize all helper code that templates ever need in there. Obviously, there is still room for improvements. The next steps will be a new element to help plugins and probably another one for admin pages (obviously there is some overlap between the two).

Plugins

I’ve written recently about some new plugin ideas, but there are a number of still unfinished plugins in the repository and it seems it is about time to get some of those done. A quick browse brings up the following:

  • product associations
    A generic association plugin. The focus has slightly changed recently, with a new idea being that there could be a generic association framework (presumably in core) and plugins that can add some sort of data source to drive relationships between products.
  • product features
    This really needs some time to get up to speed with recent changes and to make it actually work again as it was, before even trying to attempt improving it!
  • promotions
    There are some concepts and ideas, but not a lot of code yet. The basics are rule based promotions (perhaps realized as order totals) to allow discounts, etc
  • surcharge
    This is almost complete and will add another class of plugins to ZenMagick, namely order totals! Based on regular expressions it allows to add surcharges based on checkout data (right now this is used to implement a surcharge for certain credit cards).
  • dev tools
    Collection of developer tools. The language tool is one candidate to move there, as are a few things like a database table mapping generator and other useful stuff
  • affiliate
    There is a nice affiliate mod that I’ve started converting to ZenMagick. Most of the storefront is done, but as usual, the admin side takes time – if anyone is keen on plugin UI development, please let me know!
  • redirect/forward
    As described in my other post about plugins.

Other stuff

There are the obligatory bug fixes, some more cleanup and removal of deprecated code. The plan is to move all deprecated code into a separate plugin to allow people to upgrade while continue to use that old code. Most likely the legacy settings will move there too.

March 16, 2009

another release

Last night ZenMagick 0.9.5 was finally released! I am quite excited about this particular release, because it includes a couple things that make ZenMagick a lot more attractive to existing Zen Cart installations.

For one thing, there is a new patch that allows plugins to access the final HTML content of Zen Cart templates. This has been around in ZenMagick (for themes) for quite a while and proves to be very powerful.

A lot of the storefront plugins (page stats, page caching, google analytics) depend on this feature and now they can be used with Zen Cart templates too!
If you head over to the demo store you’ll see that the HTML generated by the default Zen Cart template is caches like any other page, following the same rules!

Another quite surprising thing (at least  for me!) is the new PDO based ZMDatabase implementation. It seems to be the fastest implementation so far and the demo store seems to do fine using it, so I might make it the default implementation for the next release.

There are also improvements to existing plugins and, of course, a couple new ones. The most interesting one is probably the phpBB3 plugin. It provides the same features as Zen Cart’s phpBB support, just for phpBB3.

I also really like the new theme toggle plugin that allows to switch between Zen Cart and ZenMagick. Probably not very useful for a production environment, but good to compare features, displayed values, etc.

Of course, this is not the end, and I’ve already started working on the next version. In that context a reminder that with 0.9.6 I’ll be removing a lot of the deprecated stuff. Also, the deprecated API support will be removed before a 1.0.0 release, but most likely not before 0.9.8.

March 14, 2009

demo store update

I’ve just updated the demo store with a release candidate version of ZenMagick 0.9.5.

There are some interesting visual and other changes that the demo store illustrates:

  • Use of PDO based database API
  • New plugin to switch between ZenMagick and Zen Cart template
  • Improved event support for Zen Cart templates (that’s what the switch is really for!)
    The extended event support now allows ZenMagick plugins to manipulate the final HTML of Zen Cart templates. That means, all ZenMagick plugins that rely on this mechanism can now be used in Zen Cart templates, too! Obvious examples are the page stats and style switch plugin (even though the style switch doesn’t really work for Zen Cart templates, right now).

One thing that is now good to see is the difference in database queries. Even though the Zen Cart default template and the ZenMagick themes do not display exactly the same data, it’s still impressive to see the difference in queries :)

I somehow lost my release notes so the public release will have to wait until early next week to give me time to get organized again.

Happy demo’ing!

March 9, 2009

releases coming

I happened to notice a  search ‘when is zencart 2.0 actually coming‘ in today’s log. It’s a good question. Unfortunately I do not know the answer, but I do know that the next ZenMagick release is not far!

Today I checked in the final changes to make the category pages use the new sql based pagination code that hopefully will be on par with the way Zen Cart handles it [(except for being a lot more complex, of course ;) ].

That means that the last bit I was hoping to get into the next release is actually in place. I’ll be doing some more testing and try to figure out which plugins need updates. That should hopefully get me to a point where I can write release notes and build ZenMagick 0.9.5 next weekend!

I think I really need to do something about the plugins. Ideally, they would all have their individual changelogs, but right now with core changes that affect pretty much all plugins that seems to be overkill. I guess for 1.0 that might be something to look into, though.

Coming back to the search mentioned above: Of course there is no need to wait for Zen Cart 2.0 in order to enjoy things like:

  • Plugins that do not require file changes
  • A simple template structure that does not need include/require
  • A database API incl. DAO’s, transaction control and support for different database providers
  • A MVC based framework
  • Flexible form validation with rules to change both JavaScript and server side validation in a single place
  • Guest checkout aka. checkout without registering
  • and a lot more

Just start using ZenMagick today!

March 5, 2009

release preview

With the number of things on my todo list for the next release shringking fast its time to have a look at what is about to happen in the next ZenMagick release.
I’ve already written about a few things, but I think it is also nice to have it all in one place. (Also, these posts are usually good starting points for writing the release notes!)

So, here’s a list of things to look out for int he next release:

  • Banner Management
    So far, banners where identified by index (integer) and needed a setting each in order to work. As of 0.9.5 this is going to be simplified and there is actually already some documentation about how things are going to work.
  • Database API
    A number of things changed here, in particular the ability to create type mappings on-the-fly and support for array model data in all xxxModel() methods should make life simpler in a few cases
  • define refactoring
    A lot more defines have been converted into consts in the appropriate classes. Defines are fine, however, I feel that consts are a lot more readable and also it’s easier to find where things actually are in the source code.
  • ZMLayout refactoring
    The service class ZMLayout has been renamed ZMTemplateManager in reflect the newly added methods to manage CSS and JavaScript resources. Short story is that it allows to add CSS to a page even after the <head> section has been created by the template.
  • Support for large result lists
    I’ve explained this already, so I’ll just say that the new solution is SQL based and pretty close (at the bottom) to what Zen Cart currently does.
  • Plugins
    As usual there will be new plugins. First, an initial version of a plugin to manage custom ZenMagick settings in the database. It uses some new widgets and I expect that with the number of widgets growing there will be a lot of improvements in the future.
    Secondly, support for phpBB3 at the same level as currently exists for phpBB2.
    There are also improvements and fixes for a number of other plugins that are, of course, listed in the changelog.
  • Open
    A couple things are still open, but should be included, time permitting: a new search page based on the already existing ZMProductFinder class, make all unit tests pass!

February 12, 2009

beans and bugs

Tags: , , , , , ,
Filed under: ZenMagick — DerManoMann @ 4:15 am

A couple more bugs have been found which must have been around for a while, actually. Not sure why noone picked those up or reported them, though.
Anyway, just a friendly reminder that it pays off to keep an eye on the bug tracker. Even if bugs are only fixed in the next release, the comments usually contain workarounds to avoid getting a cold.

On a different matter I’ve added another bean related method and also some new unit tests for bean handling.

The new method is called getBean($definition). It’s only a few lines of code, but allows to do something like this:

$obj = ZMBeanUtils::getBean('ZMObject#foo=bar&x=y');

After that, you’ll have an instance of ZMObject in $obj with the methods setFoo('bar'); and setX('y'); called.

First place where this is going to be used is as syntax tfor config options. Plugins will be able to specify widget classes and multiple properties to render the form elements of their configuration options.

Perhaps it will even be possible to extend the simple syntax [classname]#[property1=value1&proerty2value2&...] to reference existing objects?

Next on the list is to add support for this to the url mappings. That will allow to specify both controller and view properties without the need for more parameter (instead there will be less!)

February 8, 2009

neither plugin nor theme

Last week I was asked if it would be possible to use the CSS click-show-hide menu mod in ZenMagick. After some quick testing it turned out that only some minor changes are required in order to get it working.

Of course, there are some things that could be nicer. With product counts enabled the generated category tree uses an additionl 260 database queries (even thought that is not really news).

I changed the mod to using the ZenMagick API which kind of fixed that problem. One minor issue remained, though. The original Zen Cart code calcualtes the product count on a category sub-tree, not just the actual category. So the numbers are not quite the same. I might fix this, even though I doubt that this is a major showstopper.

The really interesting question now is how to wrap up the resulting files. All there is are the original javaSript, CSS and image files (CSS image path adjused to suit the ZenMagick file structure), the class that generates the HTML and the sidebox template file.

(more…)

Next Page »