Hi Roland,

Wow, getting this working would be cool. Translateable URLs --> very nice 
feature!
I agree with you that it won't be that easy.

I would take a look at the implementation of the URL-shortening feature that is 
already present in magnolia. The URL-shortening works in a similar way: the 
request comes in with a "short" url, magnolia determines the full path in order 
to correctly handle security and rendering, and then when links are rendered, 
they are shortened again for the correctly rendered output.
(Note: URL shortening is what you configure under site definition --> mappings)
I don't know if this mechanism is 100% pluggable/extensible, but I think basing 
the URL translation on the URL shortening would be the correct way to build 
this feature into magnolia without changing too much stuff in the process.

Some things to think about:
- For untranslated content, you will have the same content available under 
different URL-paths (something google doesn't really like).
- Normally, Magnolia determines language based on "en" or "de" (locale codes) 
inserted at the start of the URL. In theory you would not need this once your 
solution works. You could determine the desired language based on the 
translation chosen for the first path element (i.e. /products --> en content, 
/produkte --> de content)
- Building a complete "translation tree" for the different language paths (and 
keeping it in memory), will definitely beat always having to search all 
children for the one with property en_Name=="products" at each node

If you feel like it, let us know how this goes. It would be a really cool 
feature if it works well!

Regards from Vienna,

Richard 

-----Ursprüngliche Nachricht-----
Von: [email protected] [mailto:[email protected]] 
Im Auftrag von Roland Polzer (via Magnolia Forums)
Gesendet: Freitag, 11. Jänner 2013 11:10
An: Magnolia User List
Betreff: [magnolia-user] How can I use localized URLs?

Our customers want to use localized URLs because this is better for SEO. 
Magnolia can localize the title of a document, but not the name. As described 
in 
http://documentation.magnolia-cms.com/technical-guide/i18n.html#Onehierarchyormany
 we would like to have ONE hierarchy.

Can we add another attribute to documents to specify what to be used for URLs 
instead of the node name?

My document structure is
/products
/products/cars
/products/cars/domestic
/products/cars/foreign
/products/furniture

but the URLs for the German website should be:
/produkte
/produkte/autos
/produkte/autos/deutsch
/produkte/autos/ausland
/produkte/moebel

Support suggested to have a filter before the security filter (because security 
is based on the real path, not the localized) and then internally forward to 
the target page. We would then also have to change how links are rendered.

Has anyone implemented something like this? I guess we need a map from 
localized to real path, but where to store the map (memory, repository) and how 
to update?

I don't think that this is easy to implement but it should be Magnolia feature.

Cheers,
Roland

-- 
Context is everything: 
http://forum.magnolia-cms.com/forum/thread.html?threadId=9117cf02-aea9-431b-8205-be1348c486e6


----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------





----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to