PHP code example of omz13 / kirby3-xmlsitemap
1. Go to this page and download the library: Download omz13/kirby3-xmlsitemap library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
omz13 / kirby3-xmlsitemap example snippets
return [
'omz13.xmlsitemap.cacheTTL' => 60,
'omz13.xmlsitemap.itemap.excludePageWhenTemplateIs' => [ 'contact','sandbox' ],
'omz13.xmlsitemap.excludePageWhenSlugIs' => [ 'form' ],
'omz13.xmlsitemap.excludeChildrenWhenTemplateIs' => [ 'events','one-pager','shop','team','testimonials' ],
],
];
return [
'omz13.xmlsitemap' => [
'cacheTTL' => 60,
'lateIs' => ['contact','sandbox'],
'excludePageWhenSlugIs' => [ 'form' ],
'excludeChildrenWhenTemplateIs' => [ 'events','one-pager','shop','team','testimonials' ],
'disableImages' => false,
],
];
return [
'debug' => true,
'omz13.xmlsitemap' => [
'omz13.xmlsitemap.debugqueryvalue' => 'wombat,'
'omz13.xmlsitemap.dePageWhenTemplateIs' => ['contact','sandbox'],
'omz13.xmlsitemap.excludePageWhenSlugIs' => [ 'form' ],
],
];
'omz13.xmlsitemap.addPages' => function() {
return kirby()->collection('articles');
}
'omz13.xmlsitemap.addPages' => function() {
$c = new Kirby\Cms\Pages;
$c->add( kirby()->site()->find('blog/the-sweet-dessert') );
return $c;
}
<?= $page->headLinkAlternates();