Copied to clipboard

Flag this post as spam?

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


  • Lesley 107 posts 349 karma points
    Jul 21, 2020 @ 02:09
    Lesley
    0

    Language variants - how to get URL for default language version of page if culture-specific page does not exist

    We have a menu with 3 items e.g. Page1, Page2, Page3. All 3 items are the same document type.

    Page3 has two languages, however, Page1 and Page2 only have the default language.

    How can we render a culture-specific menu with Page1 and Page2 pointing to the default language version of the pages, and Page3 pointing to culture-specific version? e.g.

    • Page1 = website/page1
    • Page2 = website/page2
    • Page3 = website/zh/page3

    I can access all 3 pages using home.ChildrenForAllCultures, and I can get the page heading using page.Value("pageHeading", fallback: Fallback.ToDefaultValue, defaultValue: page.Name), but I can't figure out how to get the correct url for the default language page.Url = "#" and page.UrlSegment is null

    There doesn't seem to be an option to get the default language version of a page so you can access standard page properties such as the url.

  • Wojciech Tengler 96 posts 199 karma points
    Jan 18, 2024 @ 16:30
    Wojciech Tengler
    1

    Hi,

    You can find an explanation and solution in the article: Problem with linking in Umbraco across pages in different cultures.

Please Sign in or register to post replies

Write your reply to:

Draft