[TYPO3] wrap content
typo3 at accio.lv
Tue Sep 12 12:16:31 CEST 2006
Akos Horvath wrote:
> I always have problem with wrapping elements.
You need to understand how TS works.
> I would like typo to wrap
> the rightcontent (styles.content.getRight) in a DIV, but only if it
> contains something (ie not empty). I tried with this:
> lib.rightcontent = HTML
Ok, so "lib.rightcontent" is HTML
> lib.rightcontent < styles.content.getRight
Now you copied "styles.content.getRight" to it and it became CONTENT
because "styles.content.getRight" is CONTENT. Thus your previous line is
discarded. So it was not needed at all.
> lib.rightcontent.wrap = <div class="rightdiv"> | </div>
Checking TSRef at
yes, "wrap" property exists. It will always wrap.
> PLUS I tried with
> lib.rightcontent.wrap.required = 1
Checking "wrap" type: it is "wrap", not "stdWrap", so "required"
property does not exist for it.
> BUT it always wraps if the content is empty or not
Correct behavior with your TS. You need to use stdWrap instead of wrap.
Try this TS:
lib.rightcontent < styles.content.getRight
lib.rightcontent.stdWrap.wrap = <div class="rightdiv"> | </div>
lib.rightcontent.stdWrap.required = 1
"It is our choices, that show what we truly are,
far more than our abilities." (A.P.W.B.D.)
More information about the TYPO3-english