[TYPO3-english] Typoscript stdWrap if COA element not empty

Arun Chandran arunchandran2010 at gmail.com
Tue Jun 30 08:07:59 CEST 2015


Hi,

Yes. I know its little bit complicated. Opening and closing tags are in
different places. But according to my requirement I need to implement like
this. Can you suggest me a solution for this?

Thanks,
Arun Chandran
PIT Solutions Pvt Ltd.

On Tue, Jun 30, 2015 at 11:28 AM, bernd wilke <t3ng at bernd-wilke.net> wrote:

> Am 30.06.15 um 06:59 schrieb Arun Chandran:
>
>> Hi Guys,
>>
>> I've a typoscript configuration to build a small HTML structure. Starting
>> of the HTML tag is in a plugin template and closing in typoscript. I mean;
>>
>> lib.contactbox = COA
>> lib.contactbox {
>>      10 < plugin.tx_myext_pi1
>>
>>      20 < styles.content.get
>>      20.select.where = colPos = 3
>>
>>      wrap = |</div>
>> }
>>
>> Here my extension start an HTML tag and closing is in typoscript. It works
>> fine.
>>
>
> no. it does not work fine. otherwise you would not have this problem.
>
>  But my problem is, if there is no content from plugin, then the close div
>> tag is working which breaks HTML. So my requirement is only the wrap of
>> closing div works when there is any content from plugin.
>>
>> I've tried the following script but not working;
>>
>> lib.contactbox = COA
>> lib.contactbox {
>>      stdWrap.wrap = |</div>
>>      stdWrap.required = 1
>>
>>      10 < plugin.tx_myext_pi1
>>
>>      20 < styles.content.get
>>      20.select.where = colPos = 3
>> }
>>
>> If anybody knows the solution, then please help;
>>
>
> you can build a very complicated structure to test whether your plugin
> returns empty (copy the plugin inside your typoscript or store the value in
> a register for two reads) but the easiest way is: close the div where the
> information about emptyness is orinated: inside the plugin.
>
> I always use a variable for the return value of a function and try to have
> only one exit at the end. In that way I can test for empty just before
> returning and can append a closing div if not empty.
>
> in general I would avoid having opening and ending tags at different
> places.
> TYPO3 uses 'wraps', which means: something before and something after and
> that is exact the structure of HTML: .wrap = opentag|closetag
> Also this wraps (can) occur only if content is available avoiding empty
> wraps: .required = 1
>
> bernd
> --
> http://www.pi-phi.de/cheatsheet.html
>
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english
>


More information about the TYPO3-english mailing list