public function SimpleSitemapViews::getIndexableVariants in Simple XML sitemap 8.3
Same name and namespace in other branches
- 4.x modules/simple_sitemap_views/src/SimpleSitemapViews.php \Drupal\simple_sitemap_views\SimpleSitemapViews::getIndexableVariants()
Returns an array of indexable sitemap variants for view display.
Parameters
\Drupal\views\ViewExecutable $view: A view executable instance.
string|null $display_id: The display id. If empty uses the current display.
Return value
array An array of sitemap variants.
1 call to SimpleSitemapViews::getIndexableVariants()
- SimpleSitemapViews::getIndexableViews in modules/
simple_sitemap_views/ src/ SimpleSitemapViews.php - Returns an array of executable views whose current display is indexable.
File
- modules/
simple_sitemap_views/ src/ SimpleSitemapViews.php, line 518
Class
- SimpleSitemapViews
- Class to manage sitemap data for views.
Namespace
Drupal\simple_sitemap_viewsCode
public function getIndexableVariants(ViewExecutable $view, $display_id = NULL) {
// Ensure the display was correctly set.
if (!$view
->setDisplay($display_id)) {
return [];
}
$variants = $this->sitemapManager
->getSitemapVariants(NULL, FALSE);
foreach (array_keys($variants) as $variant) {
if (!$this
->getSitemapSettings($view, $variant)) {
unset($variants[$variant]);
}
}
return $variants;
}