Copied to clipboard

Flag this post as spam?

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


  • Corné Strijkert 80 posts 456 karma points c-trib
    Aug 05, 2020 @ 10:39
    Corné Strijkert
    0

    How to get current tree culture in AngularJS from custom dashboard?

    Hi all,

    In Umbraco 8 I've a custom dashboard that shows content in a list. Because it's a multilingual site there are multiple variants of the tree. Normally, when you select another culture in the dropdown above the tree, the URL will be updated with a 'mculture={culture}' parameter.

    You can get this parametervalue with $routeParams.mculture. So far so good.

    But the problem I have currently is when someone is typing in '/umbraco' in the browser URL field. Then it takes some time, before the 'mculture' parameter becomes available, but in the meanwhile the custom dashboard calls some API for getting the content, but the 'mculture' setting is not yet available. So, this results in always getting the content in the default culture.

    Is there some event or something available to wait for the $routeParams when it's complete?

    Anybody? Much appreciated!

    Corné

  • Corné Strijkert 80 posts 456 karma points c-trib
    Aug 05, 2020 @ 10:49
    Corné Strijkert
    0

    Ok, i just found out that there's a 'UMB_MCULTURE' cookie. I can use that cookie, so I think this works for me as a workaround.

    Beside that I was curious if someone knows a way to use the $routeParams. Because, when the user switches the current active language, I would like to know on my custom dashboard that the tree culture has changed, to reload my dashboard for that culture as well.

Please Sign in or register to post replies

Write your reply to:

Draft