TYPO3: Wrap RECORDS if not empty or hidden in TemplaVoila

avall picture avall · Jul 25, 2011 · Viewed 8.6k times · Source

I have a field mapped in TemplaVoila as "container of elements" which generates some Typoscript in "Data processing":

10= RECORDS
10.source.current=1
10.tables = tt_content

# my new added wrap
10.wrap = <div class="someClass"> | </div>

Is there a way to make my new wrap depend on filling this container? I need the same functionality as:

10 = TEXT
10.wrap = not empty: |
10.required = 1

EDIT: I managed to check if any content is in the container:

10= RECORDS
10.source.current=1
10.tables = tt_content
10.stdWrap.wrap = <div class="someClass"> | </div>
10.stdWrap.if {
 isTrue.field = field_contenttop
}
10.stdWrap.debugData = 1

It works but wraps container even if contents inside are hidden. I need to depend wrap on visible elements only.

Answer

maholtz picture maholtz · Nov 4, 2011

i guess stdWrap.required = 1 does the job.

10= RECORDS
10.source.current=1
10.tables = tt_content
10.stdWrap.wrap = <div class="someClass"> | </div>
10.stdWrap.required = 1