Bug #80422
closedTYPO3 8.6.1 mixing FLUID and JS - CDATA doesn't work as before
0%
Description
This worked until 7.6 but in 8.6.1 CDATA seems to have a different behavior inside a Fluidtemplate.
Inside the CDATA-section {s} and {z} are not escaped but omitted.
<script>
var lati = {field.lati};
var longi = {field.longi};
var map = L.map('map', {zoomControl: false}).setView([{field.lati}, {field.longi}], 13);
<![CDATA[
L.tileLayer('http://{s}.tiles.mapbox.com/v3/uhradone.ija63bia/{z}/{x}/{y}.png', {
attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://mapbox.com">Mapbox</a>',
maxZoom: 18
}).addTo(map);
]]>
</script>
Updated by Jan Greth over 7 years ago
Same Bug occures here in CMS 8.7.4 - Are there any news?
Thomas Hezel wrote:
This worked until 7.6 but in 8.6.1 CDATA seems to have a different behavior inside a Fluidtemplate.
Inside the CDATA-section {s} and {z} are not escaped but omitted.<script>
var lati = {field.lati};
var longi = {field.longi};
var map = L.map('map', {zoomControl: false}).setView([{field.lati}, {field.longi}], 13);<![CDATA[
L.tileLayer('http://{s}.tiles.mapbox.com/v3/uhradone.ija63bia/{z}/{x}/{y}.png', {
attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://mapbox.com">Mapbox</a>',
maxZoom: 18
}).addTo(map);]]>
</script>
Updated by Benni Mack over 7 years ago
- Project changed from 1664 to TYPO3 Core
- TYPO3 Version set to 8
Updated by Andreas Kießling about 7 years ago
I don't know if the description from Thomas is what i stumpled up on: CDATA blocks are completely omitted from my output.
AFAIR they were not touched at all in previous versions, which was sometimes needed if the output contains a lot of curly braces and Fluid would choke on it otherwise.
Updated by Riccardo De Contardi about 5 years ago
<f:format.cdata>
or the instruction {parsing off}
can be of help here? (I didn't test by myself).
Updated by Georg Ringer 8 months ago
- Status changed from New to Closed
Closing this because nothing will change there. Having inline code is bad anyway - I strongly suggest to use data attributes to hand data to JS and have the JS code as external file included.