[TYPO3-core] RFC: #10118: Make pi_wrapInBaseClass wraps configurable

JoH asenau info at cybercraft.de
Mon Jan 18 12:23:49 CET 2010


> - If pi_wrapInBaseClass is set in the TypoScript setup of a plugin, it
> is used as wrap/stdWrap. Examples:
>
> plugin.tx_t3cpodcasts_pi1 {
>    pi_wrapInBaseClass = <div class="PODCAST">|</div>
> }
>
> plugin.tx_t3cpodcasts_pi1 {
>    pi_wrapInBaseClass.dataWrap = <div
> class="PODCAST-{field:pid}">|</div> }

According to TSref these examples must behave like i.e. outerWrap then.

The result of the first pi_wrapInBaseClass would be

<div class="PODCAST">
    some output
</div>

this would be according to the "value" property of TEXT elements.


Due to the missing first wrap the result of the second pi_wrapInBaseClass
with dataWrap only would be

<div class="PODCAST-123"></div>
some output

This could be avoided by setting

pi_wrapInBaseClass = |


With both pi_wrapInBaseClass AND dataWrap together you would get

<div class="PODCAST">
    <div class="PODCAST-123">
        some output
    </div>
</div>

If this is the intended behaviour, we must make sure to have it documented
properly, so people will use it as intended.
IMHO it would be better to just assign a TypoScript switch for the base
class AND a default stdWrap to pi output to avoid any confusion.

This would be the default base class wrap:
plugin.tx_t3cpodcasts_pi1 {
    pi_wrapInBaseClass = 1
}

This would get rid of any base class wrap but add something else
individually:
plugin.tx_t3cpodcasts_pi1 {
    pi_wrapInBaseClass = 0
    stdWrap {
        dataWrap = <div class="PODCAST-{field:pid}">|</div>
    }
}

And this would combine both of them:
plugin.tx_t3cpodcasts_pi1 {
    pi_wrapInBaseClass = 1
    stdWrap {
        dataWrap = <div class="PODCAST-{field:pid}">|</div>
    }
}

Just my 2 cents

Joey

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your gob sometimes!)
Dieter Nuhr, German comedian
Xing: http://contact.cybercraft.de
Twitter: http://twitter.com/bunnyfield
TYPO3 cookbook (2nd edition): http://www.typo3experts.com




More information about the TYPO3-team-core mailing list