Commit d4b538da authored by gbyte.co's avatar gbyte.co Committed by gbyte.co

Issue #2961233 by gbyte.co: Allow for multiple sitemap types on one Drupal instance

parent f0ea8767
......@@ -2,7 +2,7 @@ max_links: 2000
cron_generate: true
cron_generate_interval: 0
remove_duplicates: true
skip_untranslated: false
skip_untranslated: true
batch_process_limit: 1500
base_url: ''
custom_links_include_images: false
......
label: 'Default hreflang'
description: 'The default hreflang sitemap type.'
sitemap_generator: 'default'
url_generators:
- 'custom'
- 'entity'
- 'entity_menu_link_content'
- 'arbitrary'
variants:
default:
label: 'Default'
type: 'default_hreflang'
......@@ -25,13 +25,13 @@ simple_sitemap.settings:
custom_links_include_images:
label: 'Include images of custom links'
type: boolean
enabled_entity_types:
label: 'Enabled entity types'
excluded_languages:
label: 'Excluded languages'
type: sequence
sequence:
type: string
excluded_languages:
label: 'Excluded languages'
enabled_entity_types:
label: 'Enabled entity types'
type: sequence
sequence:
type: string
......@@ -72,3 +72,39 @@ simple_sitemap.custom:
changefreq:
label: 'Change frequency'
type: string
simple_sitemap.types.*:
label: 'Sitemap types'
type: config_object
mapping:
label:
label: 'Type label'
type: string
description:
label: 'Type description'
type: string
sitemap_generator:
label: 'Sitemap generator'
type: string
url_generators:
label: 'URL generators'
type: sequence
sequence:
type: string
simple_sitemap.variants:
label: 'Sitemap variants'
type: config_object
mapping:
variants:
label: 'Sitemap variants'
type: sequence
sequence:
type: mapping
mapping:
label:
label: 'Variant label'
type: string
type:
label: 'Sitemap type'
type: string
......@@ -15,9 +15,13 @@
* This hook gets invoked for every sitemap chunk generated.
*
* @param array &$links
* Array containing multilingual links generated for each path to be indexed.
* Array containing multilingual links generated for each path to be indexed
*
* @param string|null $sitemap_variant
*
* @todo Make work for sitemap types.
*/
function hook_simple_sitemap_links_alter(array &$links) {
function hook_simple_sitemap_links_alter(array &$links, $sitemap_variant) {
// Remove German URL for a certain path in the hreflang sitemap.
foreach ($links as $key => $link) {
......@@ -43,12 +47,13 @@ function hook_simple_sitemap_links_alter(array &$links) {
* Add arbitrary links to the sitemap.
*
* @param array &$arbitrary_links
* @param string|null $sitemap_variant
*/
function hook_simple_sitemap_arbitrary_links_alter(array &$arbitrary_links) {
function hook_simple_sitemap_arbitrary_links_alter(array &$arbitrary_links, $sitemap_variant) {
// Add an arbitrary link.
// Add an arbitrary link to all sitemap variants.
$arbitrary_links[] = [
'url' => 'http://this-is-your-life.net/tyler',
'url' => 'http://some-arbitrary-link/',
'priority' => '0.5',
// An ISO8601 formatted date.
......@@ -66,6 +71,15 @@ function hook_simple_sitemap_arbitrary_links_alter(array &$arbitrary_links) {
'de' => 'http://this-is-your-life.net/en/tyler',
]
];
// Add an arbitrary link to the 'fight_club' sitemap variant only.
switch ($sitemap_variant) {
case 'fight_club':
$arbitrary_links[] = [
'url' => 'http://this-is-your-life.net/tyler',
];
break;
}
}
/**
......@@ -73,8 +87,9 @@ function hook_simple_sitemap_arbitrary_links_alter(array &$arbitrary_links) {
* Attributes can be added, changed and removed.
*
* @param array &$attributes
* @param string|null $sitemap_variant
*/
function hook_simple_sitemap_attributes_alter(array &$attributes) {
function hook_simple_sitemap_attributes_alter(array &$attributes, $sitemap_variant) {
// Remove the xhtml attribute e.g. if no xhtml sitemap elements are present.
unset($attributes['xmlns:xhtml']);
......@@ -85,8 +100,9 @@ function hook_simple_sitemap_attributes_alter(array &$attributes) {
* Attributes can be added, changed and removed.
*
* @param array &$index_attributes
* @param string|null $sitemap_variant
*/
function hook_simple_sitemap_index_attributes_alter(array &$index_attributes) {
function hook_simple_sitemap_index_attributes_alter(array &$index_attributes, $sitemap_variant) {
// Add some attribute to the sitemap index.
$index_attributes['name'] = 'value';
......@@ -95,16 +111,67 @@ function hook_simple_sitemap_index_attributes_alter(array &$index_attributes) {
/**
* Alter properties of and remove generator plugins.
*
* @param array $generators
* @param array $url_generators
*/
function hook_simple_sitemap_url_generators_alter(array &$generators) {
function hook_simple_sitemap_url_generators_alter(array &$url_generators) {
// Remove the entity generator.
// Useful when creating your own entity generator plugin.
unset($generators['entity']);
unset($url_generators['entity']);
}
/**
* Alter properties of and remove generator plugins.
*
* @param array $sitemap_generators
*/
function hook_simple_sitemap_sitemap_generators_alter(array &$sitemap_generators) {
// Remove the default generator.
unset($sitemap_generators['default']);
}
/**
* @param array $sitemap_types
*/
function hook_simple_sitemap_types_alter(array &$sitemap_types) {
// Remove the custom links generator from the default sitemap type definition.
$key = array_search('custom', $sitemap_types['default_hreflang']['url_generators']);
unset($sitemap_types['default_hreflang']['url_generators'][$key]);
// Define a new sitemap type to be generated with the default sitemap generator.
// Make it use only the custom and arbitrary link generators.
$sitemap_types['fight_club_sitemap_type'] = [
'label' => t('Fight Club Sitemap'),
'description' => t('The second rule of Fight Club is...'),
'sitemap_generator' => 'default',
'url_generators' => [
'custom',
'arbitrary',
],
];
}
/**
* @param array $variants
*/
function hook_simple_sitemap_variants_alter(array &$variants) {
// Add a new sitemap variant of the 'fight_club_sitemap_type' type.
$variants['fight_club'] = [
'type' => 'fight_club_sitemap_type',
'label' => t('Fight Club'),
];
}
/**
* @param $bundle_settings
* @param $entity_type_id
* @param $bundle_name
*/
function hook_simple_sitemap_bundle_settings_alter(array &$bundle_settings, $entity_type_id, $bundle_name) {
// Change the weight of the arbitrary link generator.
$generators['arbitrary']['weight'] = -100;
}
/**
......
......@@ -30,7 +30,7 @@ function simple_sitemap_requirements($phase) {
case 'runtime':
$generator = \Drupal::service('simple_sitemap.generator');
$generated_ago = $generator->getGeneratedAgo(SitemapGeneratorBase::DEFAULT_SITEMAP_TYPE); //todo
$generated_ago = $generator->getGeneratedAgo(SitemapGeneratorBase::DEFAULT_SITEMAP_VARIANT); //todo
$cron_generation = $generator->getSetting('cron_generate');
if (!$generated_ago) {
......@@ -450,4 +450,36 @@ function simple_sitemap_update_8210() {
return t('The XML sitemap needs to be regenerated.');
}
/**
* Adding simple_sitemap.variants and simple_sitemap.types to configuration.
*/
function simple_sitemap_update_8211() {
$config_factory = \Drupal::service('config.factory');
// Add simple_sitemap.types.
$config_factory
->getEditable('simple_sitemap.types.default_hreflang')
->setData([
'label' => 'Default hreflang',
'description' => 'The default hreflang sitemap type.',
'sitemap_generator' => 'default',
'url_generators' => [
'custom',
'entity',
'entity_menu_link_content',
'arbitrary',
],
])->save();
// Add simple_sitemap.variants.
$config_factory
->getEditable('simple_sitemap.variants')
->set('variants', [
'default' => [
'label' => 'Default',
'type' => 'default_hreflang',
]
])->save();
}
......@@ -5,29 +5,29 @@ simple_sitemap.sitemap_default:
requirements:
_access: 'TRUE'
simple_sitemap.sitemap_type:
path: '/sitemaps/{type}/sitemap.xml'
simple_sitemap.sitemap_variant:
path: '/sitemaps/{variant}/sitemap.xml'
defaults:
_controller: '\Drupal\simple_sitemap\Controller\SimplesitemapController::getSitemap'
requirements:
_access: 'TRUE'
simple_sitemap.sitemap_type_fallback:
path: '/sitemaps/{type}'
simple_sitemap.sitemap_variant_fallback:
path: '/sitemaps/{variant}'
defaults:
_controller: '\Drupal\simple_sitemap\Controller\SimplesitemapController::getSitemap'
requirements:
_access: 'TRUE'
simple_sitemap.sitemap_type_delta:
path: '/sitemaps/{type}/{delta}/sitemap.xml'
simple_sitemap.sitemap_variant_delta:
path: '/sitemaps/{variant}/{delta}/sitemap.xml'
defaults:
_controller: '\Drupal\simple_sitemap\Controller\SimplesitemapController::getSitemap'
requirements:
_access: 'TRUE'
simple_sitemap.sitemap_type_delta_fallback:
path: '/sitemaps/{type}/{delta}'
simple_sitemap.sitemap_variant_delta_fallback:
path: '/sitemaps/{variant}/{delta}'
defaults:
_controller: '\Drupal\simple_sitemap\Controller\SimplesitemapController::getSitemap'
requirements:
......
......@@ -10,6 +10,7 @@ services:
- '@path.validator'
- '@date.formatter'
- '@datetime.time'
- '@module_handler'
- '@simple_sitemap.batch'
- '@plugin.manager.simple_sitemap.url_generator'
- '@plugin.manager.simple_sitemap.sitemap_generator'
......
......@@ -41,26 +41,10 @@ class SitemapGenerator extends Plugin {
*/
public $description;
/**
* An integer to determine the weight of this generator relative to others.
*
* @var int
*/
public $weight = 0;
/**
* Whether the generator is enabled by default.
*
* @var bool
*/
public $enabled = TRUE;
/**
* Default generator settings.
*
* @var array
*/
public $settings = [
'default' => FALSE,
];
public $settings = [];
}
......@@ -41,26 +41,10 @@ class UrlGenerator extends Plugin {
*/
public $description;
/**
* An integer to determine the weight of this generator relative to others.
*
* @var int
*/
public $weight = 0;
/**
* Whether the generator is enabled by default.
*
* @var bool
*/
public $enabled = TRUE;
/**
* Default generator settings.
*
* @var array
*/
public $settings = [
'default_sitemap_generator' => 'default',
];
public $settings = [];
}
......@@ -81,6 +81,8 @@ class Batch {
->setContext($context)
->setSettings($arguments['settings'])
->setBatchMeta($batch_meta)
->setSitemapVariant($arguments['variant'])
->setSitemapGeneratorId($arguments['sitemap_generator'])
->generate($arguments['data_set']);
}
......@@ -97,6 +99,7 @@ class Batch {
\Drupal::service('plugin.manager.simple_sitemap.sitemap_generator')
->createInstance($arguments['sitemap_generator'])
->setSettings($arguments['settings'])
->setSitemapVariant($arguments['variant'])
->generateIndex();
}
......@@ -112,6 +115,7 @@ class Batch {
public static function removeSitemap(array $arguments, array $batch_meta, &$context) {
\Drupal::service('plugin.manager.simple_sitemap.sitemap_generator')
->createInstance($arguments['sitemap_generator'])
->setSitemapVariant($arguments['variant'])
->remove();
}
......
......@@ -48,13 +48,14 @@ class SimplesitemapController extends ControllerBase {
}
/**
* Returns the whole sitemap of a certain type, its requested sitemap chunk,
* Returns the whole sitemap variant, its requested chunk,
* or its sitemap index file.
* Caches the response in case of expected output, prevents caching otherwise.
*
* @param string $type
* Optional name of sitemap type. This corresponds to the plugin ID
* of the sitemap generator plugin to be responsible for the generation.
* @param string $variant
* Optional name of sitemap variant.
* @see \hook_simple_sitemap_variants_alter()
* @see Simplesitemap::getSitemapVariants()
*
* @param int $delta
* Optional delta of the sitemap chunk. If none provided, the first chunk or
......@@ -65,8 +66,8 @@ class SimplesitemapController extends ControllerBase {
* @return object
* Returns an XML response.
*/
public function getSitemap($type = SitemapGeneratorBase::DEFAULT_SITEMAP_TYPE, $delta = NULL) {
$output = $this->generator->getSitemap($type, $delta);
public function getSitemap($variant = SitemapGeneratorBase::DEFAULT_SITEMAP_VARIANT, $delta = NULL) {
$output = $this->generator->getSitemap($variant, $delta);
if (!$output) {
$this->cacheKillSwitch->trigger();
throw new NotFoundHttpException();
......
......@@ -16,10 +16,6 @@ use Drupal\Component\Datetime\Time;
* id = "default",
* title = @Translation("Default sitemap generator"),
* description = @Translation("Generates a standard conform hreflang sitemap of your content."),
* weight = 0,
* settings = {
* "default" = true,
* },
* )
*/
class DefaultSitemapGenerator extends SitemapGeneratorBase {
......@@ -108,16 +104,19 @@ class DefaultSitemapGenerator extends SitemapGeneratorBase {
$this->writer->startElement('urlset');
// Add attributes to document.
$attributes = self::$attributes;
if (!$this->isHreflangSitemap()) {
unset(self::$attributes['xmlns:xhtml']);
unset($attributes['xmlns:xhtml']);
}
$this->moduleHandler->alter('simple_sitemap_attributes', self::$attributes);
foreach (self::$attributes as $name => $value) {
$sitemap_variant = $this->sitemapVariant;
$this->moduleHandler->alter('simple_sitemap_attributes', $attributes, $sitemap_variant);
foreach ($attributes as $name => $value) {
$this->writer->writeAttribute($name, $value);
}
// Add URLs to document.
$this->moduleHandler->alter('simple_sitemap_links', $links);
$sitemap_variant = $this->sitemapVariant;
$this->moduleHandler->alter('simple_sitemap_links', $links, $sitemap_variant);
foreach ($links as $link) {
// Add each translation variant URL as location to the sitemap.
......
......@@ -17,7 +17,11 @@ abstract class SitemapGeneratorBase extends SimplesitemapPluginBase implements S
const FIRST_CHUNK_DELTA = 1;
const INDEX_DELTA = 0;
const DEFAULT_SITEMAP_TYPE = 'default';
// todo Move this to Simplesitemap class?
const DEFAULT_SITEMAP_VARIANT = 'default';
const DEFAULT_SITEMAP_TYPE = 'default_hreflang';
const GENERATED_BY = 'Generated by the Simple XML sitemap Drupal module: https://drupal.org/project/simple_sitemap.';
const XML_VERSION = '1.0';
const ENCODING = 'UTF-8';
......@@ -53,6 +57,11 @@ abstract class SitemapGeneratorBase extends SimplesitemapPluginBase implements S
*/
protected $writer;
/**
* @var string
*/
protected $sitemapVariant;
/**
* @var array
*/
......@@ -87,6 +96,7 @@ abstract class SitemapGeneratorBase extends SimplesitemapPluginBase implements S
$this->languageManager = $language_manager;
$this->time = $time;
$this->writer = $sitemap_writer;
$this->sitemapVariant = self::DEFAULT_SITEMAP_VARIANT;
}
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
......@@ -102,6 +112,15 @@ abstract class SitemapGeneratorBase extends SimplesitemapPluginBase implements S
);
}
/**
* @param $sitemap_variant
* @return $this
*/
public function setSitemapVariant($sitemap_variant) {
$this->sitemapVariant = $sitemap_variant;
return $this;
}
/**
* @param array $links
* @return string
......@@ -111,7 +130,7 @@ abstract class SitemapGeneratorBase extends SimplesitemapPluginBase implements S
protected function getChunkInfo() {
return $this->db->select('simple_sitemap', 's')
->fields('s', ['delta', 'sitemap_created', 'type'])
->condition('s.type', $this->getPluginId())
->condition('s.type', $this->sitemapVariant)
->condition('s.delta', self::INDEX_DELTA, '<>')
->execute()
->fetchAllAssoc('delta');
......@@ -130,8 +149,10 @@ abstract class SitemapGeneratorBase extends SimplesitemapPluginBase implements S
$this->writer->startElement('sitemapindex');
// Add attributes to document.
$this->moduleHandler->alter('simple_sitemap_index_attributes', self::$indexAttributes);
foreach (self::$indexAttributes as $name => $value) {
$attributes = self::$indexAttributes;
$sitemap_variant = $this->sitemapVariant;
$this->moduleHandler->alter('simple_sitemap_index_attributes', $attributes, $sitemap_variant);
foreach ($attributes as $name => $value) {
$this->writer->writeAttribute($name, $value);
}
......@@ -155,7 +176,7 @@ abstract class SitemapGeneratorBase extends SimplesitemapPluginBase implements S
*/
public function remove() {
$this->db->delete('simple_sitemap')
->condition('type', $this->getPluginId())
->condition('type', $this->sitemapVariant)
->execute();
return $this;
}
......@@ -169,13 +190,13 @@ abstract class SitemapGeneratorBase extends SimplesitemapPluginBase implements S
*/
public function generate(array $links) {
$highest_id = $this->db->query('SELECT MAX(id) FROM {simple_sitemap}')->fetchField();
$highest_delta = $this->db->query('SELECT MAX(delta) FROM {simple_sitemap} WHERE type = :type', [':type' => $this->getPluginId()])
$highest_delta = $this->db->query('SELECT MAX(delta) FROM {simple_sitemap} WHERE type = :type', [':type' => $this->sitemapVariant])
->fetchField();
$values = [
'id' => NULL === $highest_id ? 0 : $highest_id + 1,
'delta' => NULL === $highest_delta ? self::FIRST_CHUNK_DELTA : $highest_delta + 1,
'type' => $this->getPluginId(),
'type' => $this->sitemapVariant,
'sitemap_string' => $this->getXml($links),
'sitemap_created' => $this->time->getRequestTime(),
];
......@@ -183,21 +204,24 @@ abstract class SitemapGeneratorBase extends SimplesitemapPluginBase implements S
$this->db->insert('simple_sitemap')->fields($values)->execute();
}
/**
* @throws \Exception
*/
public function generateIndex() {
if (!empty($chunk_info = $this->getChunkInfo()) && count($chunk_info) > 1) {
$index_xml = $this->getIndexXml($chunk_info);
$highest_id = $this->db->query('SELECT MAX(id) FROM {simple_sitemap}')->fetchField();
$this->db->merge('simple_sitemap')
->key(['delta' => self::INDEX_DELTA, 'type' => $this->getPluginId()])
->key(['delta' => self::INDEX_DELTA, 'type' => $this->sitemapVariant])
->insertFields([
'id' => NULL === $highest_id ? 0 : $highest_id + 1,
'delta' => self::INDEX_DELTA,
'type' => $this->getPluginId(),
'type' => $this->sitemapVariant,
'sitemap_string' => $index_xml,
'sitemap_created' => $this->time->getRequestTime(),
])
->updateFields([
'type' => $this->getPluginId(),
'type' => $this->sitemapVariant,
'sitemap_string' => $index_xml,
'sitemap_created' => $this->time->getRequestTime(),
])
......
......@@ -19,7 +19,6 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
* id = "arbitrary",
* title = @Translation("Arbitrary URL generator"),
* description = @Translation("Generates URLs from data sets collected in the hook_arbitrary_links_alter hook."),
* weight = 20,
* )
*/
class ArbitraryUrlGenerator extends UrlGeneratorBase {
......@@ -89,9 +88,12 @@ class ArbitraryUrlGenerator extends UrlGeneratorBase {
* @inheritdoc
*/
public function getDataSets() {
$data_sets = [];
$arbitrary_links = [];
$this->moduleHandler->alter('simple_sitemap_arbitrary_links', $arbitrary_links);
return [$this->getPluginDefinition()['settings']['default_sitemap_generator'] => [0 => array_values($arbitrary_links)]];
$sitemap_variant = $this->sitemapVariant;
$this->moduleHandler->alter('simple_sitemap_arbitrary_links', $arbitrary_links, $sitemap_variant);
$data_sets[] = array_values($arbitrary_links);
return $data_sets;
}
/**
......
......@@ -21,8 +21,6 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
* id = "custom",
* title = @Translation("Custom URL generator"),
* description = @Translation("Generates URLs set in admin/config/search/simplesitemap/custom."),
* weight = 0,
* enabled = true,
* )
*
*/
......@@ -100,10 +98,13 @@ class CustomUrlGenerator extends UrlGeneratorBase {
/**
* @inheritdoc
*
* @todo Support sitemap variants.
*/
public function getDataSets() {
$this->includeImages = $this->generator->getSetting('custom_links_include_images', FALSE);
return [$this->getPluginDefinition()['settings']['default_sitemap_generator'] => [0 => array_values($this->generator->getCustomLinks())]];
$data_sets[] = array_values($this->generator->getCustomLinks());
return $data_sets;
}
/**
......@@ -138,7 +139,6 @@ class CustomUrlGenerator extends UrlGeneratorBase {
: [],
'meta' => [
'path' => $path,
'sitemap_generator' => $this->getPluginDefinition()['settings']['default_sitemap_generator']
]
];
......
......@@ -2,6 +2,7 @@
namespace Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGenerator;
use Drupal\Core\Extension\ModuleHandler;
use Drupal\simple_sitemap\EntityHelper;
use Drupal\simple_sitemap\Logger;
use Drupal\simple_sitemap\Simplesitemap;
......@@ -20,7 +21,6 @@ use Drupal\Core\Menu\MenuLinkTree;
* id = "entity_menu_link_content",
* title = @Translation("Menu link URL generator"),
* description = @Translation("Generates menu link URLs by overriding the 'entity' URL generator."),
* weight = 5,
* settings = {
* "overrides_entity_type" = "menu_link_content",
* },
......@@ -33,11 +33,16 @@ class EntityMenuLinkContentUrlGenerator extends UrlGeneratorBase {
*/
protected $menuLinkTree;
/**
* @var \Drupal\Core\Extension\ModuleHandler
*/
protected $moduleHandler;
/**
* EntityMenuLinkContentUrlGenerator constructor.
* @param array $configuration
* @param string $plugin_id
* @param mixed $plugin_definition
* @param $plugin_id
* @param $plugin_definition
* @param \Drupal\simple_sitemap\Simplesitemap $generator
* @param \Drupal\simple_sitemap\Plugin\simple_sitemap\SitemapGenerator\SitemapGeneratorManager $sitemap_generator_manager
* @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
......@@ -45,6 +50,7 @@ class EntityMenuLinkContentUrlGenerator extends UrlGeneratorBase {
* @param \Drupal\simple_sitemap\Logger $logger
* @param \Drupal\simple_sitemap\EntityHelper $entityHelper
* @param \Drupal\Core\Menu\MenuLinkTree $menu_link_tree
* @param \Drupal\Core\Extension\ModuleHandler $module_handler
*/
public function __construct(
array $configuration,
......@@ -56,7 +62,8 @@ class EntityMenuLinkContentUrlGenerator extends UrlGeneratorBase {
EntityTypeManagerInterface $entity_type_manager,
Logger $logger,
EntityHelper $entityHelper,
MenuLinkTree $menu_link_tree
MenuLinkTree $menu_link_tree,
ModuleHandler $module_handler
) {
parent::__construct(
$configuration,
......@@ -70,6 +77,7 @@ class EntityMenuLinkContentUrlGenerator extends UrlGeneratorBase {
$entityHelper
);
$this->menuLinkTree = $menu_link_tree;
$this->moduleHandler = $module_handler;
}
public static function create(
......@@ -87,7 +95,8 @@ class EntityMenuLinkContentUrlGenerator extends UrlGeneratorBase {
$container->get('entity_type.manager'),
$container->get('simple_sitemap.logger'),
$container->get('simple_sitemap.entity_helper'),
$container->get('menu.link_tree')
$container->get('menu.link_tree'),
$container->get('module_handler')
);
}
......@@ -97,10 +106,21 @@ class EntityMenuLinkContentUrlGenerator extends UrlGeneratorBase {
public function getDataSets() {
$data_sets = [];
$bundle_settings = $this->generator->getBundleSettings();
if (!empty($bundle_settings['menu_link_content'])) {
foreach ($bundle_settings['menu_link_content'] as $bundle_name => $settings) {
$entity_type_name = 'menu_link_content';
if (!empty($bundle_settings[$entity_type_name])) {
foreach ($bundle_settings[$entity_type_name] as $bundle_name => $settings) {
$bundle_name_alterable = $bundle_name;
$this->moduleHandler->alter('simple_sitemap_bundle_settings', $settings, $entity_type_name, $bundle_name_alterable);
// Skip this bundle if it is to be generated in a different sitemap variant.
if (NULL !== $this->sitemapVariant && isset($settings['variant'])
&& $settings['variant'] !== $this->sitemapVariant) {
continue;