Current Version: Version 0.3
Example:
http://test.djamoer.net/assets/libs/chunktpl_v0.3/example/
Hi guys, still remember the library proposal that I did a couple weeks ago?
Here is my first official release of chunkTpl library, allowing snippets/plugins to mess around with using chunk as their template, and using a few common syntax on MODx with features support listed below:
1. Having multiple part of template collection on one chunk, with their own template variables to be parsed on that specific part.
2. Substituting placeholder with variable value.
3. Substituting placeholder with processed variable on certain behaviour (achieved using extended function capability).
4. Allowed multiple parameters to be passed on to the extended function.
5. Helper function to generate Repeater (ASP .Net) like template with MODx.
6. Helper function to create a conditional template with MODx.
7. Allow several default themes being shipped with snippets/plugins with the added API on version 0.2
Library Information
/*
* Written by: Wendy Novianto (DJAMOER Solution and Design)
* Contact: [email protected]
* Created: 2/15/2006
* Modified: 2/15/2006
* For: MODx cms (modxcms.com)
* Name: [Library] Chunk Template (chunkTpl)
* Version: Version 0.3
* Description: Library class to display a chunk of text or MODx chunk as a template
* with some other features on it.
* Releases:
* - Version 0.1 - Release the first prototype of the chunkTpl library
* - Version 0.2 - Added themes API for easily having a theme system for snippets/plugins
* - Version 0.3 - Change the template syntax to use semicolon and allow multiple parameters being passed
*/
The solution might not be sophisticated enough, but it’s really simple, which allowing a more extendable class for snippets coder.
It’s adviseable to put the library under /assets/libs/chunkTpl_v0.1/
The reason to that, if some snippets already use version 0.1, and there is a major overhaul in the syntax on version 0.2, then a users able to install this two different library classes on one MODx installation.
Any question, suggestion or comments are welcome. I would love to discuss this further, as this is only the beginning of what’s coming next from Raymond, with his idea of GreenCore.
Sincerely,
ATTENTION: I just changed the zip file for version 0.1 (I did a few modification for the template system on Repeater and Conditional)