fabianmichael / kirby-meta

All-in-one solution to all of your SEO/OpenGraph/JSON-LD needs. 👀

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

exclude pages from metadata overview

jaro-io opened this issue · comments

dear @fabianmichael,
i would like to exclude all unlisted pages from the metadata overview. the one thats directly accessible through the hamburger menu in the panel. is there some kind of setting for this? if not, do you have a suggestion on where to add this? would also be super cool if it was possible to exclude custom pages with an array like for the sitemap config.

thank you so much for your help.
such a great plugin!
🤍 ✨

@jaro-io Good idea. I’ll have a look into that in the near future.

@jaro-io I just added a filter callback option allowing you to provide a callback function in config (fabianmichael.meta.panel.view.filter). Hope, that helps :-) Re-open if not.

@fabianmichael wow, how cool! thank you so much for your time on this! 🙏 ✨ i was just playing around with it but couldn’t get it to work until now. can you maybe provide an example?

this is where i am at currently for the config.php (the first two settings work fine):

// seo meta plugin
'fabianmichael.meta.robots.canonical' => false,
'fabianmichael.meta.theme.color' => '#fefaf0',
'fabianmichael.meta.panel.view.filter' => function ($page) {
    return $page->intendedTemplate() != 'product';
}

if i use the filter function elsewhere it works totally fine:

dump($site->index()->filter(function ($page) {
    return $page->intendedTemplate() != 'product';
}));

@jaro-io I’ve copied your code and tried with the templates available on my test setup. However, it worked fine for me, just like prior tests did …

😵‍💫
so sorry @fabianmichael
there has been an issue with the installation on my end, which i was able to fix.

again, thank you so much for your time.
it is now working BEAUTIFULLY!
🌻

@jaro-io No worries :-)