Enable "Menu: Main navigation" in the Sitemap by default

Created on 13 December 2024, 8 days ago

Problem/Motivation

When you install Drupal CMS with SEO tools recipe, the Sitemap module is installed. This module is preconfigured in a way, that the sitemap on /sitemap is empty (it has only Site front page plugin enabled).

I do not think it has any value if we enable it and it will be empty. I suggest that we enable the Menu: Main navigation plugin, so that at least links from the Main navigation menu are displayed here.

Steps to reproduce

Install Drupal CMS with SEO tools recipe
Visit sitemap on /sitemap, the sitemap is empty
Visit sitemap config on /admin/config/search/sitemap to see that only frontpage plugin is enabled

Proposed resolution

Enable also Menu: Main navigation plugin

Remaining tasks

User interface changes

API changes

Data model changes

πŸ“Œ Task
Status

Active

Component

Track: SEO

Created by

πŸ‡ΈπŸ‡°Slovakia poker10

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @poker10
  • πŸ‡ΊπŸ‡ΈUnited States thejimbirch Cape Cod, Massachusetts

    Great issue! This was not possible with recipes when this recipe was created. Since the Sitemap module keeps the plugins in its sitemap.settings.yml, we were not able to change that file and continue to be idempotent.

    With the introduction of config:strict in 10.4, we now can.

    We want:

    page_title: Sitemap
    path: /sitemap
    message:
      value: ''
      format: plain_text
    plugins:
      frontpage:
        base_plugin: frontpage
        enabled: true
        weight: 0
        settings:
          title: 'Front page'
          rss: /rss.xml
        id: frontpage
        provider: sitemap
      'menu:main':
        base_plugin: menu
        enabled: true
        weight: 0
        settings:
          title: 'Main navigation'
          show_disabled: false
        id: 'menu:main'
        provider: sitemap
    include_css: true

    Instead of:

    page_title: 'Sitemap'
    path: 'sitemap'
    message:
      format: 'plain_text'
      value: ''
    plugins: []
    include_css: true
    
  • πŸ‡ΊπŸ‡ΈUnited States thejimbirch Cape Cod, Massachusetts

    MR added.

  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    One minor stylistic question. This would probably also benefit from a very simple test of some kind, just to prevent it from regressing in the future.

  • πŸ‡ΊπŸ‡ΈUnited States thejimbirch Cape Cod, Massachusetts
Production build 0.71.5 2024