Closed (fixed)
Project:
XML sitemap
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
14 Sep 2018 at 23:04 UTC
Updated:
2 Aug 2019 at 08:37 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
arrowThe attached patch allows you to set your default base URL by setting xmlsitemap_base_url in your settings.php like so:
This will override any value previously set during installation of the module or set via the module settings page. It also disables the Default Base URL field on the settings page.
Comment #3
arrowComment #4
arrowFixed a line error in the patch.
Comment #5
MerryHamster commentedI use "version": "1.0.0-alpha2" and patch #4 doesn't work for me.
So I created the patch from #4 for one.
Comment #6
MerryHamster commentedComment #8
MerryHamster commentedComment #9
MerryHamster commentedAdded a little fix for the patch from #5 for 'alpha2' version.
Comment #10
rob holmes commentedRe-roll
Comment #12
rob holmes commentedReinstate missing use Drupal\Core\Site\Settings;
Comment #13
karens commentedWe've run into this as well. We need to be able to deploy a number of new sites automatically from configuration and we don't want to have to manually configure this each time.
Comment #14
karens commentedSeems to work fine and tests pass.
Comment #15
liam morlandInstead of:
$base_url_override ? TRUE : FALSE;You can do:
(bool) $base_url_overrideComment #16
pifagorComment #17
alex_optimComment #18
pifagorComment #20
pifagorComment #22
norman.lolNice work! Finally I found this one when I was halfway through changing the base URL to
$GLOBALS['base_url']everywhere. I wonder if this still wouldn't be a nice addition that if the Settings was omitted to fallback to$GLOBALS['base_url']. By that the value could also simply be passed from the--urioption using Drush.drush -y xmlsitemap:rebuild --uri=example.com