Question

I have a store with both English and German views

The tree structure has both language versions, so I have manually changed Product to equal Produkte in the category section for example.

My problem is how to handle links in such a setup. In the main product page, I have a link such as this: href="{{store direct_url='products/phones.html'}}"

When I change to the German view, that link returns a 404. It doesn't automatically redirect to the german version which is produkte/fones.html (as an example).

Shouldn't it automatically redirect? I don't have to recode all my links by hand do I ?

update:

adding some additional information to clarify the issue>

the category structure of the shop is setup in both English and German. The categories have been translated, so when you are in the EN shop and change to the DE shop, then menus update and work correctly.

So, the 'phones' menu item becomes 'fones' - and works as expected.

In my landing page, I have the same link hardcoded (as above). How can I get it to goto the right page automatically?

Was it helpful?

Solution

In the CMS pages and the static blocks you should use the Catalog Category Link widget:

{{widget type="catalog/category_widget_link" template="catalog/category/widget/link/link_block.phtml" id_path="category/5"}}

If you use this the correct links will be built on each store and you won't have to rewrite them.

OTHER TIPS

I am not sure if this works also for direct_url's but you might also be interested in the Magento Languages URL's extension:

https://github.com/klein0r/magento-language-routes

Magento Language Routes

Features:

  • Translate all URLs for each store (e.g. /customer/account/create -> /kunde/konto/erstellen)
  • Easy translation without development skills by using the backend
  • Translate third party extensions out of the box
  • Ability to translate URLs to CMS pages, too
  • Extension uses the Magento Cache to avoid performance issues
  • Manage permissions for translations by roles
  • Old URLs are still working (even if they translated)
  • Inline-Translation of URLs
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top