I've got a multilingual website. Each product belongs to either the EN/FR Tree and I've got a link at the top of my website that switches the language. Currently however the link only goes to the frontpage of the corresponding language.
Within the Products pages I'd like to be able to make the switch happen so that if someone switches the language they go to the FR/EN version of that product.
Each EN/FR Product has a similar "productID" Property so I was wondering how I might get the link to the proper page using the Property Value of productID.
Currently I can access this property id from @Umbraco.Field("productID") of the current page, but I'm looking to get the URL from the other page that contains the same Product ID. Hope this makes sense. I'm looking to do this is in the Partial View "Header"
Any leads/advice/examples how I might go about doing this?
Get URL of Page from Property Value
I've got a multilingual website. Each product belongs to either the EN/FR Tree and I've got a link at the top of my website that switches the language. Currently however the link only goes to the frontpage of the corresponding language.
Within the Products pages I'd like to be able to make the switch happen so that if someone switches the language they go to the FR/EN version of that product.
Each EN/FR Product has a similar "productID" Property so I was wondering how I might get the link to the proper page using the Property Value of productID.
Currently I can access this property id from @Umbraco.Field("productID") of the current page, but I'm looking to get the URL from the other page that contains the same Product ID. Hope this makes sense. I'm looking to do this is in the Partial View "Header"
Any leads/advice/examples how I might go about doing this?
Hi Andrew
Welcome to our community!
Can you show, please, examples of product urls?
Are they similar?
If yes, you can just replace culture prefix in url and redirect.
Thanks,
Alex
The product URLs seem very different.
http://domain.com/fr/produits/tous-les-produits/fromage/bouchées-au-fromage-cheddar-en-pâte/
http://domain.com/en/products/all-products/cheese/battered-cheddar-cheese-bites/
I was really hoping I could get a URL from the product number
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.