[TYPO3-ttnews] News System - Fluid Template Link Helper
JCL - Johannes C. Laxander
jc at laxander.com
Tue Jan 1 16:00:01 CET 2013
I have solved the problem. Many thanks to Georg Ringer.
In addition look at
http://git.typo3.org/FLOW3/Packages/TYPO3.Fluid.git/blob/HEAD:
/Classes/TYPO3/Fluid/ViewHelpers/ForViewHelper.php
=> iteration="fooIterator"
<f:if condition="{newsItem.relatedLinks}">
<f:then>
<f:for each="{newsItem.relatedLinks}" as="relatedLink"
iteration="linkIterator">
<f:if condition="{linkIterator.isFirst}">
<f:link.page pageUid="{relatedLink.uri}"
target="blank">
{newsItem.title}
</f:link.page>
</f:if>
</f:for>
</f:then>
<f:else>
{newsItem.title}
</f:else>
</f:if>
Johannes
> -----Ursprungliche Nachricht-----
> Von: typo3-project-tt-news-bounces at lists.typo3.org
> [mailto:typo3-project-tt-news-bounces at lists.typo3.org] Im
> Auftrag von JCL - Johannes C. Laxander
> Gesendet: Montag, 31. Dezember 2012 00:41
> An: 'TYPO3 tt_news project'
> Betreff: Re: [TYPO3-ttnews] News System - Fluid Template Link Helper
>
> This Code works fine:
> <f:link.page pageUid="fileadmin/user_upload/pdf/document.pdf"
> target="blank">
>
> But how can I get the first URL from the Related Links section???
>
> >
> >
> > Additional note:
> > uri/url is a file link e.g. fileadmin/user_upload/pdf/docoument.pdf
> >
> > > Hi,
> > >
> > > in a new list view I will link the news title with the
> first url in
> > > the related link section, but my code in Partials/List/Item.html
> > > doesn't work:
> > >
> > > <f:if condition="{newsItem.relatedLinks}">
> > > <f:then>
> > > <!-- Mit dem ersten Eintrag in 'related Links'
> verlinken -->
> > > <f:link.external uri="{newsItem.relatedLinks.0.uri}"
> > > target="blank">
> > > {newsItem.title}
> > > </f:link.external>
> > > </f:then>
> > > <f:else>
> > > {newsItem.title}
> > > </f:else>
> > > </f:if>
> > >
> > > The generated Link is "http:///". With f:link.page it's the page
> > > itself. What's wrong?
> > >
> > > Johannes.
> > >
> > > _______________________________________________
> > > TYPO3-project-tt-news mailing list
> > > TYPO3-project-tt-news at lists.typo3.org
> > >
> >
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-tt-news
> > >
> >
> > _______________________________________________
> > TYPO3-project-tt-news mailing list
> > TYPO3-project-tt-news at lists.typo3.org
> >
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-tt-news
> >
>
> _______________________________________________
> TYPO3-project-tt-news mailing list
> TYPO3-project-tt-news at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-tt-news
>
More information about the TYPO3-project-tt-news
mailing list