83 Posts
squareweb
6 years ago
Topic

Hi,

I'd like to hide/show a field in a list based on compareson of 2 list-fields.

Case: 

Users can subscribe for workshop by button in list-view (showing all workshops).

If total number of subscribers (sql-query-fieldvalue) > max-allowed-subscribers (content-value) ==> hide subscribe-button AND show "Fully booked"-textfield.

As long as total allowed number of subscribers is not reached ==> hide "Fully booked"-textfield AND show subscribe-button.

I've bought the fields-restriction plugin but this is not solving my issue.

Any ideas somebody?

Thanks in advance,

 

Get a VIP membership
83 Posts
squareweb
6 years ago
0
Level 1

Solved this one,

introduced threshold-field (query) witch returns value if count(*) >= max-value (in list field).

If so, then threshold-field is filled, if not then threshold-field is empty.

this filled/empty-state is used in a field-restriction (paid plugin) to toggle both fields.

http://squareweb.nl/tmp/sebtreshold.jpg

Get a VIP membership