[TYPO3-mvc] Including dynamic JavaScript using Tx_Fluid_View_StandaloneView [solution]
Thomas Kieslich
thomas.kieslich at gmail.com
Tue Dec 14 20:40:57 CET 2010
Hi, general Solution like JSViewhelper will be good. Another, for me
easier Method, is use of CDATA Parts.
Example:
<script type="text/javascript">
<![CDATA[
var parameters = {
src: "]]>{settings.simple.url.stream}<![CDATA[",
autoPlay: "false",
verbose: false,
controlBarAutoHide: "true",
controlBarPosition: "bottom",
controlBarMode: "docked",
urlIncludesFMSApplicationInstance: "true",
poster: "images/poster.png",
volume: .05
};
// Embed the player SWF:
swfobject.embedSWF
(
"]]>{settings.playerPath}<![CDATA[",
"MediaPlayback]]>{uid}<![CDATA[",
]]>{settings.simple.width}<![CDATA[,
]]>{settings.simple.height}<![CDATA[,
"10.1.0",
"flash/expressInstall.swf",
parameters,
{
allowFullScreen: "true"
},
{
name: "MediaPlayback]]>{uid}<![CDATA["
});
]]>
//VideoJs
<![CDATA[
VideoJS.setupAllWhenReady({
controlsBelow: false, // Display control bar below video instead of
in front of
controlsHiding: true, // Hide controls when mouse is not over the video
defaultVolume: 0.55, // Will be overridden by user's last volume if
available
useBrowserControls: false // Dont' use the video JS controls (iPhone)
});
]]>
</script>
Its just another Way, Thomas
Am 14.12.2010 20:11, schrieb Fernando Arconada:
> There is a feature request in the issue tracker related to an alternative
> fluid syntax and managing header parts inside fluid templates
>
> El Tue, 14 Dec 2010 10:45:27 +0100, Steffen Müller escribió:
>
>> Hi Michiel,
>>
>> On 11.12.2010 20:40 Michiel Roos [netcreators] wrote:
>>>
>>> The downside to this approach is that fluid has a hard time with braces
>>> in templates. This is of course because JS also uses those braces a
>>> lot.
>>>
>>> My solution is to replace all the { in the JS with: {openingBrace} and
>>> all the } with {closingBrace}. And then all is fine
>>>
>>>
>> I'd rather like to see it the other way round. Leaving { and } unparsed
>> and use alternative delimiters for fluid. For example: ###blog.title###
>> ? *lol*
>> Could this be achieved by using some kind of JS viewHelper?
>
More information about the TYPO3-project-typo3v4mvc
mailing list