Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Andrew Durocher 2 posts 72 karma points
    Oct 03, 2017 @ 23:19
    Andrew Durocher
    0

    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?

  • Alex Skrypnyk 5908 posts 22603 karma points MVP 4x admin c-trib
    Oct 04, 2017 @ 09:29
    Alex Skrypnyk
    0

    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

  • Andrew Durocher 2 posts 72 karma points
    Oct 04, 2017 @ 11:34
    Andrew Durocher
    0

    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

  • 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.

Please Sign in or register to post replies