Help:General FAQ

From ZenMagick Wiki

Jump to: navigation, search

Contents

What's this?

ZenMagick is an API and templating package that makes it easier (in my opinion anyway) to use zen-cart.

One of the main criteria for writing ZenMagick was to minimize the number of lines of code in the templates that contain actual zen-cart logic. Also, ZenMagick provides ready to use objects to access almost all database information. For details check the service package of the API documentation.

The ZenMagick API
The API is the core of ZenMagick. It's an OO (Object Oriented) interface to (not yet) all zen-cart functionality. Internally, quite some code is still using zen-cart code, but there is also a lot new stuff.
Themes
ZenMagick comes with it's own theme system based on the [ZenMagick API]. Main features:
  • The main term for different styles is Theme. In contrast, a Template is a single HTML file used to structure the page layout. The ZenMagick theme system also contains Views and Boxes that correspond to zen-cart sideboxes and template templates.
  • A theme is always (self-)contained in a single subdirectory. This makes it so much easier to update and maintain.
  • As with zen-cart templates, themes build on top of the default theme. This is true for virtually all files involved.

There are, of course, more reasons for a new templating system:

  • Personally, I find the (re-)including from template to modules to templates very confusing and difficult to comprehend
  • There will never be SQL in any template or theme file. (Only exception I can thinkg of would be a theme that implements new functionality. Although, I still would expect the SQL to be isolated in some sort of service class.)
  • If a template needs to access the database there is always need to add code to the template itself, or to modify zen-cart; with ZenMagick all you do is use one of the available service objects.

Do I have to rewrite all my code to use ZenMagick?

Short answer: No!

Like zen-cart, ZenMagick does support what I call views. Views are HTML fragments that consist of the actual page content. The reminder of the page is controlled by (shared) page layouts and (side-)boxes.

Migrating to a ZenMagck theme will let you re-use most of your page templates.

It is also possible to use just parts of ZenMagick, for example product features. Have a look at the sample code for more details.

Why do we need more code?

Simple answer to this is: you don't :)

When I started playing around with zen-cart I struggled quite a bit with the fragmented nature of the templating system. Also, the generated HTML was not good enough for my purpose. Thanks to the improved templating in zen-cart 1.3.x this is no longer a real issue. However, I still think that the zen-cart way is not really templating - well, at least not the way I think about it.

What is your motivation?

ZenMagick was started as part of a software project for a customer. It became soon clear that I would have to add functionality to implement all requirements. Everything after that sort of just happened :).

I will continue to use it for commercial projects. That should ensure ongoing development.

What does it cost?

It's FREE and there are several good reasons for that.

  • It's based on zen-cart code and therefore subject to the GPL
  • It's not that original so that I would dare asking money for it
  • Looking at my website I think my position on Free Software is quite clear :)

There are situations though, where I will ask for compensation of my time and work: to implement features on request. However, that's entirely up the person asking, of course.

Who is maintaining ZenMagick?

Me, me and me. There might be additions to form a team, but until the code is complete enough I am reluctant to share. Of course, suggestions, patches, etc are always welcome.

Is ZenMagick ready for production?

Well, it depends. The [ZenMagick API] is definitely somethings that can be used in production. There are always changes, but those will be mostly internal or to extend and should not affect the interfaces (that is the beauty of it and one of the major reasons for writing it in the the first place!).

With the theme code it comes down to how flexible you are with following code changes in upcoming releases. The theme code is definitely going to change in some ways, whereas the API is stable (but not frozen [yet]).

Personal tools