You are here

public function SimpleSitemapViews::getSitemapSettings in Simple XML sitemap 8.3

Same name and namespace in other branches
  1. 4.x modules/simple_sitemap_views/src/SimpleSitemapViews.php \Drupal\simple_sitemap_views\SimpleSitemapViews::getSitemapSettings()

Gets the sitemap settings for view display.

Parameters

\Drupal\views\ViewExecutable $view: A view executable instance.

string $variant: The name of the sitemap variant.

string|null $display_id: The display id. If empty uses the current display.

Return value

array|null The sitemap settings if the display is indexed, NULL otherwise.

3 calls to SimpleSitemapViews::getSitemapSettings()
SimpleSitemapViews::addArgumentsToIndexByVariant in modules/simple_sitemap_views/src/SimpleSitemapViews.php
Adds view arguments to the index by the sitemap variant.
SimpleSitemapViews::getIndexableArguments in modules/simple_sitemap_views/src/SimpleSitemapViews.php
Gets the indexable arguments for view display.
SimpleSitemapViews::getIndexableVariants in modules/simple_sitemap_views/src/SimpleSitemapViews.php
Returns an array of indexable sitemap variants for view display.

File

modules/simple_sitemap_views/src/SimpleSitemapViews.php, line 178

Class

SimpleSitemapViews
Class to manage sitemap data for views.

Namespace

Drupal\simple_sitemap_views

Code

public function getSitemapSettings(ViewExecutable $view, $variant, $display_id = NULL) {
  $extender = $this
    ->getDisplayExtender($view, $display_id);

  // Retrieve the sitemap settings from the extender.
  if ($extender && $extender
    ->hasSitemapSettings()) {
    $settings = $extender
      ->getSitemapSettings($variant);
    if ($settings['index']) {
      return $settings;
    }
  }
  return NULL;
}