Zen Follower
- Join Date:
- Mar 2006
- Location:
- Rosebud, Victoria, Australia
- Posts:
- 308
- Plugin Contributions:
- 2
Support for Boilerplate HTML Chunks
Is there an easy way to support the use of common boilerplate chunks of HTML in the descriptions of products?
We often need to put common chunks of HTML code into descriptions. For example, size charts, shipping restrictions, availability, special conditions, etc. But then when they change we have to locate them all and change each one individually.
It would be nice to define these common chunks of boilerplate HTML, give them a name, and then be able to insert them into descriptions easily. Then to change them, we just need to edit the chunk in one place.
The old Etomite CMS I've used made this possible on steroids. You could define a 'chunk' of named boilerplate HTML markup. Then in a description simply enclose the chunk name in double opening and closing brackets and the chunk of HTML would be inserted at run time. For example, say you created a chunk of HTML called 'cressi-mens-wetsuit-size-chart'. To insert it into a description you'd simply enter {{cressi-mens-wetsuit-size-chart}} and it would happen automatically at run time. Editing the contents of the chunk thus changed it everywhere at run time. The reason I say it worked on steroids is because you could have chunks in chunks, plus put JavaScript and PHP code into the chunks, to make them more powerful.
A simple version of this sort of thing, even if it only supported plain HTML, would be a great addition or add-on for Zen Cart.
Obviously there would need to be a way for the chunks to be expanded when retrieving the descriptions for things like Google Product Search Feeder creation and the like.
(The old Etomite CMS also supported having 'snippets' which were handled in a similar way. But snippets contained PHP code, which could call other snippets and chunks. The combination of snippets and chunks made that CMS very powerful.)
Zen Cart 1.5.5e, PHP 5.3.29 MySQL 5.5.42