Quote from: Djamoer at Jun 10, 2006, 12:32 AM
Keep em coming marc, but make sure that you’re still keeping the original core concept, which is to serve as a library in separating a single chunk into several template parts. So it’s up to the snippet developers to choose whether they want to use the full functionality of the template library or not.
PS: Please inform me when you’re done with the looping logic for this library. I’m looking forward to test it out for you. Send me an email, because I’m hardly able to access this forum everyday.
Yes, the library will be kept and used as the way you originally designed it, that is multiple template chunks in one template. Only the extra logic is made possible also, ie. conditionals (if, else, switch) with value checking and looping of arrays. But it’s not needed to use any extra logic ofcourse if users don’t want to do it, it’s just made possible.
Like for example in the MaxiGallery snippet default template, there will be a section like:
{~switch (=BigImgLinkStyle=)~}
{~case (=slidebox=)~}
{~<a href="{+LargeImage+}" title="<b>{+ImageTitle+}</b><br />{+ImageDesc+}" rel="lightbox"><img src="{+Picture+}" class="imageview" title="{+ClickToOpenOriginal+}" alt="{+ImageLabelDate+}: {+ImageDate+}" /></a>~}
{~case (=lightboxv2=)~}
{~<a href="{+LargeImage+}" rel="lightbox" title="<b>{+ImageTitle+}</b><br />{+ImageDesc+}"><img src="{+Picture+}" class="imageview" title="{+ClickToOpenOriginal+}" alt="{+ImageLabelDate+}: {+ImageDate+}" /></a>~}
{~case (=popup=)~}
{~<a href="javascript:void(0);" onClick="javascript:openWindow(\'{+LargeImage+}\',\'{+ImageTitle+}\',\'{+window_height+}\',\'{+window_width+}\',\'gallery\')"><img src="{+Picture+}" class="imageview" title="{+ClickToOpenOriginal+}" alt="{+ImageLabelDate+}: {+ImageDate+}" /></a>~}
{~default~}
{~<a href="{+LargeImage+}" rel="external"><img src="{+Picture+}" class="imageview" title="{+ClickToOpenOriginal+}" alt="{+ImageLabelDate+}: {+ImageDate+}" /></a>~}
{~endswitch~}
But if snippet user is making his own template and he knows that he will be using just lightBox in the gallery that uses his template, he could replace all this with just:
<a href="{+LargeImage+}" rel="lightbox" title="<b>{+ImageTitle+}</b><br />{+ImageDesc+}"><img src="{+Picture+}" class="imageview" title="{+ClickToOpenOriginal+}" alt="{+ImageLabelDate+}: {+ImageDate+}" /></a>
So if user is doing a template in his own specific gallery setup, he probably don’t have to use much or any logic code in the template, but it is still made possible to use, so users can build up very customizable outlooks. And we can also make multiple default templates to choose from which all can work in whatever gallery setup when we check certain parameters in the template code.
If users want to change something in the default outlook of a gallery, its still very easy even if there is little logic code around it, because the logic is very readable. And much easier to edit that than the snippet, won’t brake anyting.
The other way we could achieve the same thing in the current state of modx would be that we would move all the logic code from the template to the snippet and then ship the snippet with hundred chuncks to all possible occasions what users could modify. Then in the snippet side we would decide what chunck content to replace to what placeholder in "main template" of the gallery etc. But I think that it’s much easier for user to work with a single template with minimal easy-to-read logic code than manage tens of different chuncks and wondering what goes where in the gallery output. Or we could use much more general placeholders and make the templating more basic, but that would be just stupid.
All in all, great work Wendy and Marc with the templating library, can’t wait to see it fully implemented in MaxiGallery!
And I’m not in anyway against your principles OpenGeek and TopyL, I’m all for it to separate logic from the templates, but I can’t see an easy way to do it in the current modx. And OpenGeek said it best in the irc to me last time, it’s all up to your target group. My target is website developers who knows how to work around frameworks and simple logic code.

So I’ll definitely use this.
Everyone can use what they want, but I think that atleast the "joining several template chunks in one chunk" -possibility of this library should be straight in the modx core. But then in the other hand, snippet developers can just use this library if they want and ship it with their snippets.
What I am a bit worried of is, that to the snippet end users it may look a bit confusing when some snippets use different placeholder syntax than others.. ie. {+placeholder+} vs [+placeholder+] etc...