d4ny3l
d4ny3l

Reputation: 163

Action from extbase controller doesn't lead to correct view

I have two plugins in my extbase extension.

Pi1 is named Items with the actions list and show.

Pi2 is named Exclusive and contains the action listexclusive

listexclusive returns all Items which are tagged as exclusive. But i want a link on each item to the show action of Pi1.

In my view i did this with:

//exclusive items (Listexclusive.html)
<f:for each="{items}" as="item">

  <f:link.action pluginName="Pi1" controller="Item" action="show" arguments="{item : item}">
  <p>{item.title} // {item.price}<p>
  </f:link.action>

</f:for>

When i click on an item from the above rendered view i land on the same page instead on the detail-view from the show-action. The url looks like

http://my.local.dev/index.php?id=1333&tx_items_pi1%5Bitem%5D=229&tx_items_pi1%5Baction%5D=show&tx_items_pi1%5Bcontroller%5D=Item&cHash=f2bfb64cc56fe7f3a9652e803be7a461

How can i get a detail-view (show-action) when i click on the links (exclusive items) from the above rendered view?

any help is appreciated.

Upvotes: 1

Views: 1370

Answers (1)

Merec
Merec

Reputation: 2761

You need set the page uid of the detail page to get a link to this page. TYPO3 does not know where you have inserted the plugin with the detail view. If pageUid is not set, the link links to the same page.

<f:link.action pageUid="27836" pluginName="Pi1" controller="Item" action="show" arguments="{item : item}">
    <p>{item.title} // {item.price}<p>
</f:link.action>

You should set the UID of the detail view page in the settings section in the setup.txt of your extension. If done, you can use for example {settings.detailPageUid} in your templates.

Upvotes: 4

Related Questions