Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
#5 | 3269898-5-40.diff | 2.84 KB | kriboogh |
Issue fork simple_sitemap-3269898
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
Comment #3
kriboogh CreditAttribution: kriboogh at Calibrate commentedRe-roll patch 4.1.2
Comment #4
kriboogh CreditAttribution: kriboogh at Calibrate commentedMR applies to version 4.1.4 (D9.5).
Comment #5
kriboogh CreditAttribution: kriboogh at Calibrate commentedMR applies to version 4.1.6 (D9.5).
Merge plain diff patch added for use with composer.
Please review for RTBC ?