omz13 / kirby3-xmlsitemap

kirby3 plugin to generate an xml-based sitemap
59 stars 10 forks source link

Every child is excluded once a page has been excluded. #29

Open zvaehn opened 5 years ago

zvaehn commented 5 years ago

I have a multiple sibling pages for categories and i dont want them to be indexed, so i wrote the exlude rule:

'excludePageWhenTemplateIs' => ['category']`

Unfortunately this excluded all products as well, so i tried to add them via the addPages closure:

'addPages' => function() {
      $pages = new Kirby\Cms\Pages;
      return $pages->index()->filterBy('intendedTemplate', '==', 'product');
}

Folder Structure:

|-- Category 1
|---- Product 1
|---- Product 2
|-- Category 2
|---- Product 3
|---- Product 4

Am i missing something or is this intended behavior? Any help is appreciated. Sven

foxacid commented 5 years ago

I'm having the same issue for a very similar use case with excludePageWhenSlugIs. A fix would be very much appreciated. Thanks for a great plugin!