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.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

jérôme dehorter created an issue. See original summary.

walkingdexter’s picture

Version: 4.2.2 » 4.x-dev
Status: Needs review » Postponed (maintainer needs more info)

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

jérôme dehorter’s picture

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.

walkingdexter’s picture

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?

gbyte’s picture

Assigned: jérôme dehorter » Unassigned
Status: Postponed (maintainer needs more info) » Closed (works as designed)

Closing as per lack of activity.