Conditional fields?

field
panel

#1

Hi everybody,

are in Kirby 3 conditional fields included? I have used the fieldtoggle Plugin before but it doesn’t seem to work in K3. Maybe this is now part of the core?

For example, in Joomla it’s possible to declare a field with something like this:

showon="foo:1[AND]baz:0"

Means, this field only appears when foo has a value of 0 and baz has a value of 0. This works also with other examples like foo!:1 or similar.

Cheers


#2

No, there isnt a native way to do this, just have to wait for the plugin to be ported over. The way plugins work has totally changed with K3, so just throwing a K2 plugin in there wont work at all.


#3

That’s currently a problem to use K3. Most Plugins only work for K2 and I doesn’t have the personal skills to adapt them. Is there something like a legacy mode or similar?

I also have problems cause of the “sortable plugin” and the “tablex field”. Maybe they were ported some time. I hope :slight_smile:


#4

It can be worth looking at the branches on the github repo for the plugin - there might be a kirby 3 branch, perhaps they just havent shouted about it yet.

But for those specific plugins, i think you are out of luck for the moment.


#5

Many plugins have already been ported, but the two you mentioned above haven’t been.

The tablex plugin won’t be ported any time soon, it seems.

As regards the sortable plugin, it depends on your use case whether or not you will actually need it in Kirby 3.

Conditional fields: That’s a request many people have. I think there will be a plugin sooner or later if it’s not included in the core in the future. See https://github.com/getkirby/ideas/issues/64


#6

We also had some discussions about this in the plugins repository: https://github.com/getkirby/plugins/issues/34#issuecomment-410054182

Adding a condition property to fields (and maybe tabs etc.) would be awesome. I think this has to be done in the core, though. I tried porting the fieldtoggle plugin but it was not possible to show/hide other fields (at least for me).


#7

Would be great to see that in the core. In my opinion it’s a really useful thing to show/hide fields and options depending on other fields.


#8

Add it to the ideas repo if it’s not there already (got a feeling it might be) and you may just get your wish (I would love this too, personally)


#9

It’s already there, see link above.