0
votes

I'm using the Typo3 blog extension (tx_blog) for my website. In the blog template the link for the category overview comes from the viewhelper blog:link.category. It creates a nice URI without query parameters or chash (/blog/category/flowers) as configured.

I now need to create a link to the same category page from a template from another extension. Using the same viewhelper gives me the above uri but it adds the controller and action from my own extension as query parameters.

So I copied the viewhelper and changed the urifor call to pass on the values of the blog extension. The action when set to NULL is gone, but the controller is still added. Also the chash parameter is still there.

How can I get the right URI from a different extension context?

1
Did you looked at the v:link.actionviewhelper and all it's parameter? fluidtypo3.org/viewhelpers/fluid/7.6.0/Link/…Bernd Wilke πφ
using this configuration: <f:link.action extensionName="blog" pageUid="256" pluginName="Category" controller="Post" action="listPostsByCategory" arguments="{category:category.uid}" /> This creates the same link. It doesn't seem to respect the 'skipDefaultArguments' setting from the extension like the link from within the extension context does.J Meer
I don't think you need link.action for this. Just call the page with additional Params: <f:link.page pageUid=256" additionalParams="{category:category.uid}"> Link </f:link.page> . In combination with realURL this could create you the URL you are looking for.nbar

1 Answers

1
votes

You can use any ViewHelper installed in the system by registering it in the template head.

Example: <html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" xmlns:v="http://typo3.org/ns/Vendor/ExtensionKey/ViewHelpers" data-namespace-typo3-fluid="true">

xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" means that the namespace f can be used for the default TYPO3 ViewHelpers.

xmlns:v="http://typo3.org/ns/Vendor/ExtensionKey/ViewHelpers" is a registration of all ViewHelpers of the Extension Vendor/ExtensionKey, which can be used in the template with the namespace v.

data-namespace-typo3-fluid="true" means that the <html> element won't be in the output.