Display section based on record count

How to show or hide a component based on record count.

Overview

The issue is that ChronoForms does not have a direct setting to conditionally display elements like buttons or headers when a table's record count equals a specific number.
First, disable the 'Deactivate permissions' setting in the form's general settings. Then, use a PHP action to process the record count and return a true or false value. Finally, in the component's permissions settings, reference that value using {var:php_name} to control its visibility.

Answered
ChronoForms v6
to touretteroma 01 Apr, 2018
Dear all,
how is possible to show/hide a component (eg a button or header) when the record count of a table is equals to N ?
Regards
Max_admin Max_admin 02 Apr, 2018
Answer
Hi touretteroma,
​
This is possible but not straight forward in the current version (a planned update should make it simpler), but you can do it by following the steps below:
  1. Disable the "Deactivate permissions" setting under the form general settings.
  2. Process the record count using a PHP action and return a value true/false.
  3. In your button settings under "Permissions", use {var:php_name} to control if the button should be displayed or not.
Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.