[TYPO3-mvc] Fluid: Object-Accessor is not always working

Claus Due claus at wildside.dk
Fri Sep 14 13:25:49 CEST 2012


Hi Robert,

Then I'm not sure what is causing the problem. You should be able to use object accessors any number of times. You are sure that the template variables are correct (check if you're rendering through a loop or rendering partials/sections that you pass the correct values) and you don't have code in your Model object which can change internal properties when an accessor is used?

Cheers,
Claus

On Sep 14, 2012, at 1:14 PM, Robert Schneider <r.schneider at artworx.at> wrote:

> Hi Claus!
> 
> It is a FE template.
> 
> I have changed it to:
> 
> <h1>{product.title}</h1>
> <f:debug>{product}</f:debug>
> <f:debug>{imagePath}</f:debug>
> <f:debug>{productImage}</f:debug>
> <div class="product_picture">
>    <f:image src="{imagePath}/{productImage}" alt="{product.title}" />
> </div>
> <f:debug>{product}</f:debug>
> <f:debug>{imagePath}</f:debug>
> <f:debug>{productImage}</f:debug>
> 
> 
> The output is for both debug sections identical. This is the output:
> 
> Extbase Variable Dump
> Tx_Forumproducts_Domain_Model_Productprototypepersistent entity (uid=30, pid=0)
>   productCode => '13.40007.00' (11 chars)
>   title => 'Pocket-Bag Mini' (15 chars)
>   description => 'Dieser nützliche Begleiter bietet nicht nur eine große Werbefläche für I
>      hre Botschaft oder Ihr Logo, sondern schont auch noch die Umwelt. Drei Plast
>      ikbeutel am Stück befinden sich im Inneren und sind stets griffbereit, prak
>      tisch verstaut in der Hand- oder Hosentasche.' (273 chars)
>   dimensions => '6 x 7,2 x 1 cm' (14 chars)
>   colors => '' (0 chars)
>   quantities => '1/250/500/1000/2500/5000/10000' (30 chars)
>   prices => '0,65/0,95/0,89/0,82/0,75/0,71/0,65' (34 chars)
>   supplier => 'Emotion Factory' (15 chars)
>   top => FALSE
>   onStartPage => TRUE
>   novelty => TRUE
>   category => 'Home & Living' (13 chars)
>   imagePaths => 'Emotion Factory/Pocket-Bag_Mini.jpg' (35 chars)
>   roundImagePath => 'Emotion Factory/Pocket-Bag_Mini.png' (35 chars)
>   uid => 30 (integer)
>   _localizedUid => 30 (integer)modified
>   _languageUid => 0 (integer)modified
>   pid => 0 (integer)
> Extbase Variable Dump
> 'fileadmin/Bilder/Produktbilder' (30 chars)
> Extbase Variable Dump
> 'Emotion Factory/Pocket-Bag_Mini.jpg' (35 chars)
> 
> 
> It is not the image view helper that causes troubles. If I do it this way it works also fine:
> 
> <f:if condition="1"></f:if>
> <h1>{product.title}</h1>
> 
> What do you think about this?
> 
> Robert
> 
> 
> 
> 
> Am 14.09.2012 12:45, schrieb Claus Due:
>> Hi Robert,
>> 
>>> But the next object accessors work properly. It seems to me that f:image initializes something.
>> 
>> As far as I know this is not the case.
>> 
>> Could you try debugging this by dumping all template variables right before and right after using f:image and see if they match up? If they do match then f:image is not to blame.
>> 
>> Also, are we in FE or BE when this happens?
>> 
>> Cheers,
>> Claus
>> 
> 
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc



More information about the TYPO3-project-typo3v4mvc mailing list