[TYPO3-english] advanced typoscript wrapping needed
Walrick
lists at globalhealingcircle.net
Thu Apr 23 13:41:07 CEST 2009
bernd wilke wrote:
> the typoscript-if is something I avoided yet. And so you got a working
> solution: congratulations.
Thanks.
> Looking at your TS i found a lot of unbalanced wrappings.
> Normaly you can nest elements so the wrapping is done in a propper way
> having opening and closing tag in the same wrap .
You are right.
But the problem with nested normal wraps combined with the if-statement
is (in my experience): if the statement returns false not only is the
wrap not applied but everything inside it, both further wraps and the
actual content of the element, disappear as well, which leads to empty
pages. Not good.
The best way would have been that depending on conditions either wrap 1
(public), wrap 2 (membersonly) or wrap 3 (ctonly) gets applied.
A kind of If ... elseif ... else ...
But the typoscript-if does not seem to have an else option.
> I think it can all be done with correct wrapping instead of having tags
> in typoscript-HTML-elements or unbalanced wraps.
Well, that would be nice indeed.
> Inserting half tags in TEXT could be a bad idea, as it may be wrapped
> with other tags like '<p>', which will break nesting / syntax.
The way it's used on our website it shouldn't give any problems. But for
general purposes it might not be safe. It's difficult to judge that.
> What you need is an typoscript expert like JoH :-)
Indeed. I sure wouldn't dare to call myself an expert. Started with
TYPO3 about a year ago and this is the most advanced bit I've created so
far (although I do have quite complex menu's and a knowledgebase created
with TS instead of an extension).
> at the end it might be a nice solution which can be used often.
That would be nice. Being able to style individual content elements
based on values in the database record for that element might indeed
come in handy in more occasions.
Walrick
--
webmaster Global Healing Circle
www.globalhealingcircle.net
More information about the TYPO3-english
mailing list