0

To my customer account dashboard (and index) I want to add a custom (direct) link to a product category. This product category is only visible to logged in customers, that's why I want to have it here, too (not just in the basic store category view /listing)

I managed to list the link with adding

<action method="addLink" translate="label" module="customer">
    <name>downloads_category</name>
    <url>catalog/category/view/id/93</url>
    <label>Downloads Category</label>
</action>

to the <customer_account> block in my customer.xml file. But I struggle on getting the rewritten URL (downloads.html, as set in rewrite management). The rewrite-URL works fine in the frontend.

Using downloads.html as the <url></url> parameter will end up adding a link to /.../downloads.html/ (with that unwanted trailing slash).

Edit: I'm running Magento CE 1.9.2.2

2 Answers 2

0

You can use a helper in your layout to generate the URL.
Take a look at this subject, it may help you : Use a helper in a layout

2
  • So du you suggest that there's no "native" way to do that in magento?
    – rob_st
    Mar 2, 2016 at 11:31
  • If by native way you mean pure XML no, but this solution don't need any override or third extension, so this is kinf of native way ;) Mar 2, 2016 at 17:29
0

I managed to get the rewritten URL as href with using the urlParams as follows:

<action method="addLink" translate="label" module="customer">
    <name>downloads-category</name>
    <url>catalog/category/view/id/101</url>
    <label>Downloads</label>
    <urlParams>
         <_direct>downloads.html</_direct>
    </urlParams>
</action>

It's not dynamic but at least it is not a non-SEF-URL.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.