# Same blueprint, different defaults or visibility

**URL:** <https://forum.getkirby.com/t/same-blueprint-different-defaults-or-visibility/27470>\
**Category:** Questions\
**Tags:** v3\
**Created:** [January 6, 2023, 10:26am UTC](https://forum.getkirby.com/t/same-blueprint-different-defaults-or-visibility/27470 "2023-01-06T10:26:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![hvsrmusic](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/hvsrmusic/32/2722_2.png) [@hvsrmusic](https://forum.getkirby.com/u/hvsrmusic)\
**Post date:** [January 6, 2023, 10:26am UTC](https://forum.getkirby.com/t/same-blueprint-different-defaults-or-visibility/27470/1 "2023-01-06T10:26:42Z")

</div>

Hi,  
I’d like to use the same blueprint for different kinds of articles - let’s say “Projects” and “Posts”.

90% of the fields are the same; I would like to handle the remaining 10% setting a different default value (they’re Select fields) according to the parent page UID (‘project’ or ‘post’).

In alternative, it’s ok to have different fields, but I wasn’t able to make the WHEN property works with a query statement:

```auto
          date:
            label: Data
            type: date
            default: today
            width: 1/4
            when: page.parent.uid = "posts"

```

This would make the site’s editors work a little bit easier.

Is it possible?

thank you  
Francesco

---

<div class="post-metadata">

**Author:** ![stffr](https://avatars.discourse-cdn.com/v4/letter/s/c89c15/32.png) [@stffr](https://forum.getkirby.com/u/stffr)\
**Post date:** [January 6, 2023, 10:57am UTC](https://forum.getkirby.com/t/same-blueprint-different-defaults-or-visibility/27470/2 "2023-01-06T10:57:43Z")

</div>

You can reuse and extend blueprints, maybe that’s a better approach?

> **[Reusing & extending blueprints](https://getkirby.com/docs/guide/blueprints/extending-blueprints)**
>
> Fields, sections, tabs and entire blueprint layouts can be reused within your blueprints. If you want, you can even create a complete component system to apply to multiple projects.

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [January 6, 2023, 4:24pm UTC](https://forum.getkirby.com/t/same-blueprint-different-defaults-or-visibility/27470/3 "2023-01-06T16:24:02Z")

</div>

Default `when` only works with values from other fields on the same page. The Whenquery plugin gives you more options ([GitHub - rasteiner/k3-whenquery: Conditionally show fields and sections. Better.](https://github.com/rasteiner/k3-whenquery)), but you still **cannot** query other pages props, so won’t help for the example.

Another option are PHP blueprints:

> **[Programmable blueprints](https://getkirby.com/docs/cookbook/panel/programmable-blueprints)**
>
> Create blueprints programmatically with PHP

---

<div class="post-metadata">

**Author:** ![hvsrmusic](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/hvsrmusic/32/2722_2.png) [@hvsrmusic](https://forum.getkirby.com/u/hvsrmusic)\
**Post date:** [January 6, 2023, 4:25pm UTC](https://forum.getkirby.com/t/same-blueprint-different-defaults-or-visibility/27470/4 "2023-01-06T16:25:50Z")

</div>

…what about page.create:after hook?

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [January 6, 2023, 4:28pm UTC](https://forum.getkirby.com/t/same-blueprint-different-defaults-or-visibility/27470/5 "2023-01-06T16:28:02Z")

</div>

> [@hvsrmusic](#):
>
> …what about page.create:after hook?

You mean to set default values if no value is provided? That’s an option, although I’d personally prefer a page model that overwrites the `writeContent` method for this use case.

Won’t help with hiding/showing fields in your blueprint, though.

---

<div class="post-metadata">

**Author:** ![hvsrmusic](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/hvsrmusic/32/2722_2.png) [@hvsrmusic](https://forum.getkirby.com/u/hvsrmusic)\
**Post date:** [January 7, 2023, 8:28am UTC](https://forum.getkirby.com/t/same-blueprint-different-defaults-or-visibility/27470/6 "2023-01-07T08:28:30Z")

</div>

In the end, I’ll go with the page.create:after hook. So I can set a custom post\_type field, and then using the WHEN property on the other fields that have to be hidden.

I’ve had some troubles though, because I guess the bnomei/autoid plugin use the same hook. I’ve disabled the plugin and everything went fine (sorry @bnomei, your plugin works like a charm in all the other cases).

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [January 7, 2023, 9:04am UTC](https://forum.getkirby.com/t/same-blueprint-different-defaults-or-visibility/27470/7 "2023-01-07T09:04:06Z")

</div>

> [@hvsrmusic](#):
>
> because I guess the bnomei/autoid plugin

Unique ideas for pages, files and users are built-in since Kirby 3.8.0.

> **[Kirby 3.8](https://getkirby.com/releases/3.8)**
>
> Lost relations are a thing of the past with the new UUID and permalink features for pages, files and users.
