[TYPO3] htmlSpecialChars in dataWrap

JoH info at cybercraft.de
Mon Sep 11 12:32:21 CEST 2006


>> Thanks for the hint, but neither of these seem to generate a
>> htmlspecialchars-expected output on this TS:
>>
>> ---------------
>> NO {
>> allWrap.dataWrap = <option
>> value="{field:uid}.html">{field:subtitle}</option>
>> doNotShowLink = 1
>> }
>> -------------
>>
>> NO.allWrap.htmlSpecialChars=1
>> NO.stdWrap.htmlSpecialChars=1
>> NO.htmlSpecialChars = 1
>> NO.allWrap.dataWrap.htmlSpecialChars = 1
>>
> NO.stdWrap.htmlSpecialChars = 1 should work.
>
> First try testing to make sure that stdWrap is getting applied - try
> something like NO.stdWrap = link test- | -wrapping or something, and
> then if it works ttry a recursive call to stdWarp if need be.
>
> Don't forget you'll need to apply the same setting to the other menu
> states (CUR, ACTIFSUB, etc)

The trick is, to have a look at TSref to find out the order in which the
different stdWrap functions are applied. (It's exactly the order they are
listed at the stdWrap page).

As you can see, there is first htmlSpecialChars folllowed by some other
formatting functions wraps and dataWrap. This means:

blah.dataWrap = whatever
blah.htmlSpecialChars = 1

will give you the same result as

blah.dataWrap = whatever

since htmlSpecialChars is executed before any stuff gets inserted via
dataWrap.

To make sure it will work in the desired order you have to do it i.e. like
this:

NO.stdWrap.cObject = COA
NO.stdWrap.cObject {
    stdWrap.htmlSpecialChars = 1
    10 = TEXT
    10.dataWrap = <option value="{field:uid}.html">{field:subtitle}</option>
}

This way you get  a TEXT element first, filled by dataWrap.
Then htmlSpecialChars is applied by the stdWrap property of the COA.

In most cases it is a good idea to work with COA as a container, since you
can apply stdWrap functions on at least two different levels _and_ you can
easily add/remove some stuff lateron.

Joey

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your knob sometimes!)
Dieter Nuhr, German comedian
openBC: http://www.cybercraft.de
T3 cookbook: http://www.typo3experts.com





More information about the TYPO3-english mailing list