suggestions for an better syntax-highlighting of TYPO3-Fluid


I use sometime the Fluid-Engine of TYPO3 to generate code in javascript or css-code

The jQuery/Javascript_Code can look like this. The highlighter don't recognize the injected Fluid-syntax.The highlighter remarks many error (</, <, >, ...)
But I don't use the Fluid-Inline-code in Javascript-Code, because that reading is more terrible.


<f:if condition="{root_typoscript_css_main}">
    
if ($('#root-typoscript-css-main-<f:format.raw>{root_typoscript_object}</f:format.raw>').length <=0 ) {
        $(
'head').append('<'+'link id="root-typoscript-css-main-<f:format.raw>{root_typoscript_object}</f:format.raw>" rel="stylesheet" type="text/css" href="<f:format.raw>{root_typoscript_css_main}</f:format.raw>" /'+'>');
    }
</f:
if>

A second problem is, that the highlightuing don't recognize the TYPO3-Fluid-Inline-Code. I have often to use the inline-Code to get an valid XML-Code. A fluid-template can looks like that.
The example shows the usage of Inline-Fluid-Code in an Fluid-Expression too. I use it often in f:for-loops, to inject the loop-array which is defined in the typoscript    

<f:section name="menu.main">
    <
f:cObject typoscriptObjectPath="lib.menu.main.script" />
    <
div class="ajax">
        <
div id="{f:cObject(typoscriptObjectPath:'lib.menu.main.id')}" >
            <
f:render partial="RootMenuMain" arguments="{flag_menu_animation:'{flag_menu_animation -> f:format.raw()}'}"/>
        </
div>
     </
div>
</
f:section>


The inline-syntax of Fluid is uses in " ... ". Inline-Codes can look like "{variable}", {f:function.subfuntion( parameter: 'string-Value', ...)} or {value->f:function.subfuntion( parameter:). The parameters and subfuntion are optional.
I wish me a syntax-highlighting, which solve the problem of this syntax-injection (a foreign syntax in a main syntax" )

Dieter

P.S. Sorry about my poor english.

Please sign in to leave a comment.