Conditional form -- show admin form on all pages except XYZ

What I am trying to figure out is whether there is a good way to enable a blueprint / backend form on various pages based on a condition. This is similar to how ACF in WordPress has the line "Show this field group if … "

I know I can make a form for just a specific page by matching the .yaml file to a template .twig file of the same name. However, I’m looking for more fine grain control, and I don’t want to have make the same form 10 times for 10 different pages just to prevent it showing up on say my home page. So what I’m hoping is possible is these two things:

1) Display a form in the admin of just a list of specific pages

  • Right now I’m creating fields in blueprints/default.yaml as I want these fields on most pages, but they should NOT be showing up on certain pages which they do right now since dafault.yaml seems to apply to all pages, even if you’re using a different template.

2) Display the form if the parent page is XYX

  • This would be a bonus if it were possible, but definitely would be helpful.

Any tips or help on this would be appreciated…

Hello,

I’m not fully aware of the possibility of the admin plugin, but have you looked at this page ?
It seems that the Embedding Form (import@) could be a good start for what you want.

I hadn’t noticed that part of the docs, thanks!! That’s very cool functionality, I can make use of that for sure, but it doesn’t help in this case.

I guess one way around it is to instead create a new page template that is my de-facto default, like something called standard.html.twig and then basically assign every page except the one or two pages that I don’t want the default form on to that new template. But that seems pretty dang hacky. I really hope there is a better way?

I have think lots of folks have encountered this. My example is some hero/header fields (image and heading text). Every page on the site has the same hero layout, except the home page, which has a unique header so it doesn’t need those default fields. And so we should be able to not show those fields on the home page.