Templatier is designed around my office, where users perpetually come to me with html newslettesr that they want to go out and look pretty. I fix the same problem numerous times, only to have it re-introduced when they open it with a WYSIWYG html editor. My solution is to create this system that allows me to write an email newsletter containing the things they should be able to edit, like the time and description, while holding things like table structure static. The goal is to have the end user, someone with no HTML experience be able to use templatier to create their newsletter.
It comes with one example file, based off of the slashdot homepage. I recognize that it's a little useless in that respect, and I'd love to show you the examples I've pulled from work, however I don't know if I have permission to release those. Ironic eh? Code is fine, template not so much...
Place the contents of this directory somewhere on your webspace, and place any templates in the template folder.
- PHP >= 4.3.0
- PHP Globals off
- PHP Sessions enabled
- Probably other things I'm forgetting now.
- Changeable start and close field symbols
- Changeable comment seperators
- Multiple references to one datum
- Nested Loops
- If/Else blocks
- Single, optional blocks
- per-file configuration options
- meta-data in template
- warnings on potential missed closing tag
Directives are placed between square brackets, names are seperated from comments by a semicolon. Loops are started with the keyword loop and end with the keyword endloop or loopend. Loops may have comments attached to the opening tag only.
[loop;this is my first loop]
[name;what is the name?]
[dob;When were you born?]
NB: If you have two tags titled 'dob' they will both contain the same data, and will only be editable once. This is handy for sidebars and things like that, for example:
[loop;This contains the main story links]
[headline;Type the headline of the story here]
[story;type the content of the story here]
(Later in the page>)
When displayed for the user to edit, this will show the first loop, and allow for input of the headline and the story. It will also show the second loop and the name/comment of the fields (headline), but with a note saying that they have already been set, and to check above.