Copied to clipboard

Flag this post as spam?

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


  • Nikita 17 posts 127 karma points
    Nov 10, 2023 @ 12:09
    Nikita
    0

    This document is published but is not in the cache

    I have a lot of languages for different websites. But after migration to Umbraco v10, there are "This document is published but is not in the cache" errors near the unused "Language code" links.

    i.e. i dont need all these "Language code" links at all, only that is assigned to document type. enter image description here

  • Alex Skrypnyk 6175 posts 24176 karma points MVP 8x admin c-trib
    Nov 13, 2023 @ 10:11
    Alex Skrypnyk
    0

    Hi Nikita

    All these documents that are published but are not in the cache do not have a separate link. It will have a link only when you publish a specific language. So I think is good with the installation. You have only one link to this page.

    Thanks,

    Alex

  • Nikita 17 posts 127 karma points
    Nov 13, 2023 @ 10:19
    Nikita
    0

    Hello Alex!

    Thank you for your answer, but i don't need all these links to show at all. Because culture for this node is "en-GB" and the link is present - that is good. But i dint need all the remaining link to show at all (fi-FI, sv-SE, etc.)

  • Alex Skrypnyk 6175 posts 24176 karma points MVP 8x admin c-trib
    Nov 13, 2023 @ 10:23
    Alex Skrypnyk
    0

    There are no links, you see all these lines because these languages added to the root node of the site. But there is only 1 published language and 1 link to this doc.

  • Nikita 17 posts 127 karma points
    Nov 13, 2023 @ 10:43
    Nikita
    0

    Got it,

    but for this node only English is selected. Do you know how to remove all these "language code" lines? enter image description here

  • Alex Skrypnyk 6175 posts 24176 karma points MVP 8x admin c-trib
    Nov 13, 2023 @ 11:58
    Alex Skrypnyk
    0

    What about the root node? it could be inherited from the parent

  • Nikita 17 posts 127 karma points
    Nov 13, 2023 @ 12:01
    Nikita
    0

    This is the root node

  • Nikita 17 posts 127 karma points
    Nov 14, 2023 @ 09:41
    Nikita
    0

    I found a solution on how to modify these links but in documentation there are only two cases: 1. How to add one link, 2. How to delete all links. https://docs.umbraco.com/umbraco-cms/v/10.latest-lts/reference/notifications/editormodel-notifications/customizing-the-links-box

    Do you know how to enter multiple links?

    Here is current code:

    public void Handle(SendingContentNotification notification)
        {            
            var culture = _context.GetRequiredUmbracoContext()?.Content?.GetById(notification.Content.Id)?.GetCultureFromDomains();
    
            foreach (var url in notification.Content.Urls)
            {
                if (url.Culture == culture)
                {
                    notification.Content.Urls = new[]
                    {
                        new UrlInfo(url.Text, true, CultureInfo.CurrentCulture.Name)
                    };
                }
            }
        }
    
  • Heather Floyd 610 posts 1032 karma points MVP 6x c-trib
    Nov 04, 2024 @ 18:48
Please Sign in or register to post replies

Write your reply to:

Draft