goldnead / statamic-collapse-fieldtype

A Collapse-Fieldtype for Statamic to beautifully hide and show your fields.
MIT License
2 stars 3 forks source link

Check collapse handle in partials #4

Closed EikeBierman closed 1 year ago

EikeBierman commented 1 year ago

My aim is to pack the settings in the collapse. These settings should then be considered in the partials.

For example, whether the type is a job or a blog. Then, in the partial, I want to check the type and show or hide fields accordingly.

goldnead commented 1 year ago

Can you please elaborate, what your specific problem is or what you aim to achieve?

EikeBierman commented 1 year ago

I have an area settings. There I select the type as an example Blog. This area is provided with the collapse.

Now I have added additional fields outside this collapse defined by the type via included sets (partials).

So I have type Blog and a post image is displayed. If I select the type Job I have a location instead of a post image.

In the conditions of the Specific Fields I have specified if the type is Job show this or if type is Blog show this.

Before adding the collapse this worked as well. After installation no longer. Then I tried to change it somehow so that it takes the collapse into account. Unfortunately, this is not quite possible.

so have entered in the included sets ( partials ) then. settings.type: 'equals blog' Then it shows me the partials but still not. If I firmly deposit the fields, then it works. If I make it again as partial pure, it does not work. If I take the collapse out and make type outside again, it works with the partials.

If you have further questions, we can also demonstrate this once via teams or so.

goldnead commented 1 year ago

Thanks, can you provide some code examples? It's quite hard to picture your problem, that you are facing.