Is it posible to change layout with a yaml variable?

So, is it posible to change the LAYOUT if, for example, the category in YAML changes?

I have 2 categorys, 1: Foo and 2: bar

In

category: foo

i want something completely different that if it were

category: bar

I know there are other ways, and I know this ways, but… is it posible without any plugin or add-on?

Hello @Siroguh

I am not sure to understand your problem but:

Cheers!