Excluded urls only for specific language

Created on 23 December 2024, about 1 month ago

Problem/Motivation

Good morning,
Our website needs to remove links from pages in a specific language while keeping alternate links.
I took this example from the code of total exclusion of a language by adapting it for this specific problem.

Feature request
Status

Needs review

Version

4.2

Component

Code

Created by

🇫🇷France Jérôme Dehorter Lille

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Jérôme Dehorter
  • 🇷🇺Russia walkingdexter

    Need more information about the use case. Why can't this be solved with the "Excluded languages" setting?

  • 🇫🇷France Jérôme Dehorter Lille

    Hi @walkingdexter,
    By selecting Excluded languages ​​settings, all urls as well as alternate urls are deleted.

    In our use, the French language is main and we have pages translated into English and it is not possible to have English pages alone.
    Our client therefore asked us to keep the alternate urls for the links with the translated pages but does not wish to keep the urls of the English pages.

  • 🇷🇺Russia walkingdexter

    Thanks for the clarification. This seems to be a very specific use case. If I understand correctly, the problem can be solved with a few lines of code using hook_simple_sitemap_links_alter(). Is this true?

Production build 0.71.5 2024