Problem/Motivation

We have a multidomain, multilingual website and we would like to show the correct language related URLS in the sitemap.
For this to happen we would like to have the language param inside:

  /**
   * Replaces the base URL with custom URL from settings.
   *
   * @param string $url
   *   URL to process.
   *
   * @return string
   *   The processed URL.
   */
  protected function replaceBaseUrlWithCustom(string $url, LanguageInterface $language = NULL): string {
    return !empty($base_url = $this->settings->get('base_url'))
      ? str_replace($GLOBALS['base_url'], $base_url, $url)
      : $url;
  }

This way we can create our own UrlGenerators and override/change where necessary.

Remaining tasks

Review patch attached

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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Mschudders created an issue. See original summary.

kriboogh’s picture

Re-roll patch 4.1.2

kriboogh’s picture

Status: Needs review » Reviewed & tested by the community

MR applies to version 4.1.4 (D9.5).

kriboogh’s picture

MR applies to version 4.1.6 (D9.5).
Merge plain diff patch added for use with composer.

Please review for RTBC ?

Rajeshreeputra made their first commit to this issue’s fork.