[TYPO3-ect] Improvement of the template engine
JoH
info at cybercraft.de
Thu Jan 26 00:36:16 CET 2006
> the classical template maker looks like this: ###PROJECT_ABSTRACT### .
>
> "<h3>###PROJECT_ABSTRACT###<h3>"
> If the project name is empty the resulting output is "<h3></h3>".
>
> To suppress "<h3></h3>" you need to wrap it into a region and do some
> extra programming tricks.
>
> In php based template engines you could write:
>
> <? if($projectName!=''): ?><h3><?=$projectName; ?></h3><? endif; ?>
>
> Other template engines work on the base of XML tags.
>
> What is already planned or done?
>
> What do you propose the best direction to go with templating features?
>
> A) Extending the ### System?
> B) Develope of an XML variant?
> C) Implementing smarty or a simlar tool more officialy?
> D) Other idea
> E) Doing nothing
D)
Don't use markers to replace the content inside a tag.
Use wraps instead and markers without a tag.
HTML-Template
###MARKER1###
###MARKER2###
TS-Template
marks {
MARKER1 = TEXT
MARKER1 {
field = title
wrap = <h3>|</h3>
required = 1
}
MARKER2 = TEXT
MARKER2 {
field = bodytext
wrap = <p>|</p>
required = 1
}
}
Another option but much more complicated would be to use subparts for every
tag.
Then you could use TEMPLATE elements for each subpart and set workOnSubpart
to the corresponding part.
Inside the part you could replace markers without wraps.
I would prefer the first option though.
Joey
--
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your knob sometimes!)
Dieter Nuhr, German comedian
http://www.cybercraft.de
More information about the TYPO3-team-extension-coordination
mailing list