[TYPO3-mvc] FLUIDTEMPLATE - difference between f:cObject and f:format
Steffen Ritter
info at rs-websystems.de
Sun Feb 13 13:44:39 CET 2011
Am 12.02.2011 20:47, schrieb Tobias Liegl:
> Hi all,
>
> normally I'm a templavoila user, but with the 4.5 release I tried to use
> the new FLUIDTEMPLATE. I tested how it works, to get the normal content
> elements into the template with the following TS.
>
> ------ typoscript ------
> page = PAGE
> page {
> 10 = FLUIDTEMPLATE
> 10 {
> file = fileadmin/templates/index.html
> variables {
> content < styles.content.get
> }
> }
> }
> lib.field_content < styles.content.get
> ------ typoscript ------
>
> You see I used two different ways to assign the content - just for
> testing purposes. In the template file I have these two lines of code.
>
> ------ index.html ------
> <f:format.html>{content}</f:format.html>
> <f:cObject typoscriptObjectPath="lib.field_content" />
> ------ index.html ------
>
> With both snippets I get the following html output.
>
> <div id="c1" class="csc-default"><div class="csc-header
> csc-header-n1"><h1
> class="csc-firstHeader">Header</h1></div><pText</p></div>
>
> But after modifying the dataWrap of the header with the following code,
> I get two different outputs.
>
> lib.stdheader.stdWrap.dataWrap = |
>
> The output with <f:cObject> is:
>
> <div id="c1" class="csc-default"><h1
> class="csc-firstHeader">Header</h1><p>Text</p></div>
>
> with <f:format.html> it looks like this:
>
> <div id="c1" class="csc-default"><p><h1
> class="csc-firstHeader">Header</h1><p>Text</p></p></div>
>
> So the <div class="csc-header csc-header-n1"></div>, which I intended to
> remove, got replaced by a <p></p> with <f.format.html>.
>
> Why is this happening in this case? Is this a bug?
>
> Greets,
> Tobi
f:format does, parses the content via lib.parseFunc_rte (your configured
rte transformation for tt_content).
<f.cObject> just outputs the HTML code Generated from the lib.xyz
therefore f:cObject woudl be the correct usage - f:format a special
cases if you know what you do and need the behaviour explicetely
regards
Steffen
More information about the TYPO3-project-typo3v4mvc
mailing list