Hi all! Its my first topic here so be cheerful please
Maybe its not possible what I require and also its not very hard to look for an alternative, but anyway I think it would be a smart solution (at least for me). What I want is add blueprints fields to only descendant pages from a specific template.
Ok, for example a /portfolio template contains many items.md, how could blueprints affect only to these kind of “items”?
As i said, another solution is just make another template for portfolio_item… But i would like to know all options
Your best bet would be to indeed change the template on every subpage.
However, I think it is possible, and the only solution I can see, but it is quite advanced and kind of a hack, is to use the conditional field.
Create a default.yaml blueprint in your theme blueprints/ folder that extend the existing default.yaml
Use the conditional field to conditionnally display the fields
Open your parent page in expert mode and add: apply_to_childpage: true
Now, your specific fields should only appear on these child pages.
If you need example, I use a lot of these conditional fields on my seo plugin, example:
but too much hacking for tonight I think haha. Maybe its clearer to have 2 kinds of items instead condition directly from blueprints. Anyway that solution helps to me for modular blueprints! Do you know if I could add a field to any modular template from blueprints/modular/default.yaml?