[TYPO3-mvc] fluid <f:if > with a regular expression

Fernando Arconada falcifer2001 at yahoo.es
Sat Jun 12 13:30:16 CEST 2010


I dont like that solution cause indeed the code is
<f:for each="{outstandignProjects}" as="project">
            <div class="projectmini">
                    <h4>{project.name}</h4>
                    <f:format.crop maxCharacters="200" 
respectWordBoundaries="true"><f:format.html >{project.description}</
f:format.html></f:format.crop>
                    <f:for each="{project.images}" as="image">
                        <f:if condition="preg_match('/Thumbnail/',
{image.name})">
                        <f:then>
                            <f:image src="uploads/pics/{image.file}" 
alt="{image.alttext}" width="200px" />
                        </f:then>
                        </f:if>
                    </f:for>
            </div>

I'm passing a project list as a parameter and each project has a relation 
with images

El Sat, 12 Jun 2010 11:12:46 +0200, Christian Schwan - Dimme GmbH
escribió:

> Ok then try the render them in you controller first with foreach image
> 
> /**
> * The session data container
> * @var array
> */
> protected $img = array();
> 
> foreach ($this->imageRepository->findAll() as $image) {
> 
> $this->img[]['name'] =  $image ->getName(); $this->img[]['file'] = 
> $image ->getFile(); //// Here you can do your pre_match }
> 
> $this->view->assign('image', $this->img);
> 
> 
> 
> -----Ursprüngliche Nachricht-----
> Von: typo3-project-typo3v4mvc-bounces at lists.typo3.org
> [mailto:typo3-project-typo3v4mvc-bounces at lists.typo3.org] Im Auftrag von
> Fernando Arconada Gesendet: Samstag, 12. Juni 2010 11:02 An:
> typo3-project-typo3v4mvc at lists.typo3.org Betreff: Re: [TYPO3-mvc] fluid
> <f:if > with a regular expression
> 
> Sorry, but i want to render the image which name is "Thumbnail" or "Car"
> or "any string". I don't want to render all images in my list
> 
> 
> El Sat, 12 Jun 2010 10:51:34 +0200, Christian Schwan - Dimme GmbH
> escribió:
> 
>> He fernando,
>> 
>> you should use the image viewHelper inset...
>> 
>> http://forge.typo3.org/attachments/1003/ImageViewHelper.php
>> 
>> {namespace product=Tx_Productpresenter_ViewHelpers}
>> 
>> <product:image src="uploads/pics/{image.file}" maxW="100"/>
>>     
>>     
>> So you can render thumbs and big Images.
>> 
>> 
>> 
>> -----Ursprüngliche Nachricht-----
>> Von: typo3-project-typo3v4mvc-bounces at lists.typo3.org
>> [mailto:typo3-project-typo3v4mvc-bounces at lists.typo3.org] Im Auftrag
>> von Fernando Arconada
>> Gesendet: Freitag, 11. Juni 2010 21:55 An:
>> typo3-project-typo3v4mvc at lists.typo3.org Betreff: [TYPO3-mvc] fluid
>> <f:if > with a regular expression
>> 
>> Hello
>> 
>> I'm trying something like
>> <f:if condition="preg_match('/Thumbnail/',{image.name})"> <f:then>
>> 	{image.file}
>> </f:then>
>> </f:if>
>> 
>> but it always return true
>> 
>> any idea?
>> 
>> 
>> Kind regards
>> 
>> Fernando Arconada
>> _______________________________________________
>> TYPO3-project-typo3v4mvc mailing list
>> TYPO3-project-typo3v4mvc at lists.typo3.org
>> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-
typo3v4mvc
>> Eingehende eMail ist virenfrei.
>> Von AVG Free SB überprüft - www.avg.de Version: 9.0.829 /
>> Virendatenbank: 271.1.1/2930 - Ausgabedatum: 06/11/10 08:35:00
>> 
>> Ausgehende eMail ist virenfrei.
>> Von AVG Free SB überprüft - www.avg.de Version: 9.0.829 /
>> Virendatenbank: 271.1.1/2930 - Ausgabedatum: 06/11/10 20:35:00
> 
> _______________________________________________ TYPO3-project-typo3v4mvc
> mailing list TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
> Eingehende eMail ist virenfrei.
> Von AVG Free SB überprüft - www.avg.de Version: 9.0.829 /
> Virendatenbank: 271.1.1/2930 - Ausgabedatum: 06/11/10 20:35:00
> 
> Ausgehende eMail ist virenfrei.
> Von AVG Free SB überprüft - www.avg.de Version: 9.0.829 /
> Virendatenbank: 271.1.1/2930 - Ausgabedatum: 06/11/10 20:35:00



More information about the TYPO3-project-typo3v4mvc mailing list