Ok, it looks like this is caused by my custom route at the end of the routing file:
- Code: Select all
pagebinding:
path: /{slug}
defaults: { _controller: 'Bolt\Controllers\Frontend::record', 'contenttypeslug': 'page' }
contenttype: pages
If I remove it, then sitemap.xml is generated fine. But I still want my /{slugs} to translate to pages...
I am trying to add another custom routing entry for the sitemap, but not quite sure what to put for the defaults and so on...
How can I do that?
Here is my full routing.yml :
- Code: Select all
homepage:
path: /
defaults: { _controller: 'Bolt\Controllers\Frontend::homepage' }
search:
path: /search
defaults: { _controller: 'Bolt\Controllers\Frontend::search' }
preview:
path: /preview/{contenttypeslug}
defaults: { _controller: 'Bolt\Controllers\Frontend::preview' }
requirements:
contenttypeslug: 'Bolt\Controllers\Routing::getAnyContentTypeRequirement'
contentlink:
path: /{contenttypeslug}/{slug}
defaults: { _controller: 'Bolt\Controllers\Frontend::record' }
requirements:
contenttypeslug: 'Bolt\Controllers\Routing::getAnyContentTypeRequirement'
taxonomylink:
path: /{taxonomytype}/{slug}
defaults: { _controller: 'Bolt\Controllers\Frontend::taxonomy' }
requirements:
taxonomytype: 'Bolt\Controllers\Routing::getAnyTaxonomyTypeRequirement'
contentlisting:
path: /{contenttypeslug}
defaults: { _controller: 'Bolt\Controllers\Frontend::listing' }
requirements:
contenttypeslug: 'Bolt\Controllers\Routing::getPluralContentTypeRequirement'
pagebinding:
path: /{slug}
defaults: { _controller: 'Bolt\Controllers\Frontend::record', 'contenttypeslug': 'page' }
contenttype: pages