Blueprints for specific template children item

Hi all! Its my first topic here so be cheerful please :stuck_out_tongue:

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, 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 :wink:

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.

  1. Create a default.yaml blueprint in your theme blueprints/ folder that extend the existing default.yaml

  2. Use the conditional field to conditionnally display the fields

                   type: conditional
                   condition: "page.parent.header.apply_to_childpage ? 'true' : 'false'"
  3. 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:

Hope it helps!

1 Like

Its really helpfull! Thanks

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?