[TYPO3-english] Check if an area doesn't contain elements

Tapio Markula tapio.markula at xetpoint.fi
Thu Dec 17 11:00:17 CET 2009


JoH asenau kirjoitti:
>>> Does it work? Otherwise you are at least getting VERY close.
>>>
>>> Jeppe Donslund schrieb:
>>>> Hi Loek.
>>> [...]
>>>>         <eType_EXTRA type="array">
>>>>             <objPath>lib.btm_elm_1</objPath>
>>>>         </eType_EXTRA>
>>>    [SNIP]
>>>
>>> In general you either define a "local" TypoSript-Setup INSIDE the
>>> datastructure OR you "reference" an objPath, which then is setup
>>> inside a regular TypoScript template(NOT within the datastructure).
>>>
>>> So if it does not work move the lines 'lib.btm_elm_1=COA' with
>>> corresponding setup to the template where you define lib.element1.
>>> Since you copy  lib.element1 inside lib.btm_elm_1 you have to insert
>>> it AFTER lib.element1.
>> If it should not be an Objectpath Lib.btm_elm_1. What should it the
>> be? btm_elm_1 should contain regular TYPO3 element, but if it
>> doesn't. It should contain the element with uid 49.
> 
> Peter told you to just define the path. The definition of this path then has
> to be made in a separate TypoScript template:
> 
> Only this will stay in your TV structure:
> 
> <eType_EXTRA type="array">
>     <objPath>lib.btm_elm_1</objPath>
> </eType_EXTRA>
> 
> And this should be the "external" TypoScript defined in the SETUP part of a
> TypoScript template:
> 
> lib.btm_elm_1 = COA
> lib.btm_elm_1 {
>     10 = RECORDS
>     10 {
>         source.current = 1
>         tables = tt_content
>         stdWrap {
>             ifEmpty.cObject < lib.element1
>         }
>     }
>     stdWrap {
>         required = 1
>         wrap = <!--TYPO3SEARCH_begin--> | <!--TYPO3SEARCH_end-->
>     }
> }
> 
> "current = 1" will fill in the CSV list of content element IDs if any.
> This will switch "stdWrap.ifEmpty" to true if there aren't any values in the
> list.
> Then lib.element1 will be used instead.
> Both will be wrapped wit the comment for TYPO3SEARCH.
> This will be stripped if there is no content at all.
> 
> @Tapio: As long as you stay on the same page with your checks, most of the
> TypoScript stuff will be working as expected even with TV, since "current"
> contains the necessary information.

if "current" contains in this case the necessary information, then it is 
useful.
But that may not help, if you for some reason would change the order of 
elements.
Anyway the problem of templavoila is that the position of elements in 
the page is not stored into the table 'tt_content', when essential 
information about if a content area has elements or not is in two tables 
(tt_content and pages).


More information about the TYPO3-english mailing list