You are here

function xmlsitemap_link_frontpage_settings in XML sitemap 8

Same name and namespace in other branches
  1. 6.2 xmlsitemap.xmlsitemap.inc \xmlsitemap_link_frontpage_settings()
  2. 7.2 xmlsitemap.xmlsitemap.inc \xmlsitemap_link_frontpage_settings()
  3. 2.x xmlsitemap.module \xmlsitemap_link_frontpage_settings()

XML sitemap link type settings callback for frontpage link entity.

Parameters

array $form: Form array.

Return value

array Updated form.

1 string reference to 'xmlsitemap_link_frontpage_settings'
xmlsitemap_xmlsitemap_link_info in ./xmlsitemap.module
Implements hook_xmlsitemap_link_info().

File

./xmlsitemap.module, line 2011
xmlsitemap XML sitemap

Code

function xmlsitemap_link_frontpage_settings(array &$form) {
  if (\Drupal::currentUser()
    ->hasPermission('administer site configuration')) {
    $form['#description'] = t('The front page path can be changed in the <a href="@url-frontpage">site information configuration</a>.', [
      '@url-frontpage' => Url::fromRoute('system.site_information_settings')
        ->toString(),
    ]);
  }
  $form['frontpage_priority'] = [
    '#type' => 'select',
    '#title' => t('Priority'),
    '#options' => xmlsitemap_get_priority_options(),
    '#default_value' => \Drupal::config('xmlsitemap.settings')
      ->get('frontpage_priority'),
  ];
  $form['frontpage_changefreq'] = [
    '#type' => 'select',
    '#title' => t('Change frequency'),
    '#options' => xmlsitemap_get_changefreq_options(),
    '#default_value' => \Drupal::config('xmlsitemap.settings')
      ->get('frontpage_changefreq'),
  ];
  return $form;
}