[TYPO3-dev] Problem using & (ampersand) in headerdData

Ernesto Baschny [cron IT] ernst at cron-it.de
Mon Oct 26 15:01:37 CET 2009


Stefan Geith schrieb:

> maybe I am too dumb today:
> 
> I need to add headerData which contains the &-sign (ampersand).
> So I added this TS to my TS-Setup:
>    ...
>    headerData.1234 = TEXT
>    headerData.1234.insertData = 1
>    headerData.1234.value = <script type="text/javascript"
> src="{getIndpEnv:TYPO3_SITE_URL}index.php?eID=getMaincats&levels=2"></script>
> 
> But the '&' always gets transformed to '&amp;', so that I don't get the
> needed paramters when I generate my JS-Output ...
> 
> _How_ can I avoid this ?
> 
> I tried
>     headerData.1234.htmlSpecialChars = 0
> and many others - including a userFunc, but nothing helps.
> 
> What is the recomended way to simple ampersands to the header-data ?

I have not a solution for your problem, but in that particular case, why
do you want a "&" in the src="" of your <script> tag? That is not valid
XHTML. The &amp; would indeed be the correct output, and any browser
will send it correctly (as "&") to the server.

You could only have "&" inside a CDATA section and if it is some JS
code, you can do that my using page.inlineJS.1234 ...

Cheers,
Ernesto




More information about the TYPO3-dev mailing list