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.
The problem is: this doesn’t really require a plugin – there is no benefit in that and none of the code needs any sort of setup. All the files actually go into the theme folder, so it’s more of a theme mod/addition. What would be a good name for this?? Suggestions welcome.
Some of my ideas are:
- theme add-on
- template-mod
- ??
I’ll release the final code (perhaps with the product count fix) together with the next ZenMagick release. Reason being that the sidebox uses the new code to handle CSS files even after the HTML <head> has already being generated (this is done via the new FINALISE_CONTENT event and modification of the (cached) generated HTML).
EDIT: Of course, finishing with a screenshot is a lot more fun, so here it is. Observant reader might notice that the screenshot actually shows that I fixed getProductIdsForCategoryId() in ZMProducs to optionally run recursive…

