Skip to content

Instantly share code, notes, and snippets.

@ulrikkold
Last active November 21, 2016 13:24
Show Gist options
  • Save ulrikkold/7a16f56eb8e637a6f639 to your computer and use it in GitHub Desktop.
Save ulrikkold/7a16f56eb8e637a6f639 to your computer and use it in GitHub Desktop.
Including an overwriteDemand GET param with TYPO3 Fluid and tx_news
{namespace n=Tx_News_ViewHelpers}
<section>
<f:for each="{news}" as="newsItem" iteration="iterator">
<n:link
newsItem="{newsItem}"
settings="{settings}"
configuration="{additionalParams: '&tx_news_pi1[overwriteDemand][categories]={f:for each=\"{newsItem.categories}\" as=\"category\" iteration=\"categoryIteration\">{category.uid}<f:if condition=\"{categoryIteration.isLast}\"><f:then></f:then><f:else>,</f:else></f:if></f:for>'}">
{newsItem.title}</n:link>
</f:for>
</section>
<f:comment>The expected result of the above is a link to a detail view with the &tx_news_pi1[overwriteDemand][categories]=a,b,..n GET param attached. However, right now all I get is an exception telling me my template has the wrong number of opening tags to match my closing tags.</f:comment>
@ulrikkold
Copy link
Author

Yes, I finally found a solution: Use ext:vhs and use v:iterator to create the right csv-string for the GET param.

@Jpsy
Copy link

Jpsy commented Sep 19, 2016

Well, no wonder that you got an exeption about tag mismatch. There is no opening section tag in your template, but a closing one.

@ulrikkold
Copy link
Author

I updated the snippet to include a section start tag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment