TYPO3-metaseo icon indicating copy to clipboard operation
TYPO3-metaseo copied to clipboard

Allow pageTypeWhitelist to exclude adding to sitemap for all page types except

Open kszymukowicz opened this issue 8 years ago • 2 comments

MetaSEO version: 3.0.0 TYPO3 version: 8.7.0 PHP version: 7.1.0

Currently there is setting plugin.metaseo.sitemap.index.pageTypeBlacklist that allows to build comma separated list of all page types that I do not want to be included in sitemap.

This works well but unfortunately it is very hard to keep it up to date because after installing new extension (or even after updating some existing) I must check if extensions provides some new page types which I should add to pageTypeBlacklist :(

This is why its much more convenient to have setting like plugin.metaseo.sitemap.index.pageTypeWhitelist.

For almost 99% of my cases I would have it only one value plugin.metaseo.sitemap.index.pageTypeWhitelist = 0

And I will not have to remember to update 'pageTypeBlacklist' after installing/updating extensions.

Please let me know if you agree with that - if yes I can prepare PR then.

Thank you!

kszymukowicz avatar Dec 29 '17 16:12 kszymukowicz

In principle, this is a valid feature request. plugin.metaseo.sitemap.index.pageTypeWhitelist should again be a list of comma separated values.

We'd just have to say how to deal with a whitelist and a blacklist combined. And how to avoid introducing new breaking changes.

One way would be

  • Default to an empty pageTypeWhitelist
  • Keep the existing behaviour if pageTypeWhitelist is empty
  • Ignore pageTypeBlacklist if pageTypeWhitelist is not empty

This should of course be part of the documentation so that everybody gets it.

If you are ready to provide a PR, please go for it!

thomaszbz avatar Dec 29 '17 22:12 thomaszbz

@kszymukowicz Thanks for the patch. Just by looking at the code you provided, it looks pretty much as it should be ;-)

I'll port it back to 2.1.1 to make it available to 6.2/7.6 users as well.

thomaszbz avatar Jan 07 '18 19:01 thomaszbz