Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Hide if empty 03 Jan 2017 17:28 #14898

  • MorganL
  • MorganL's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 438
  • Thank you received: 53
Can we have an option for a field in a fly view

'Hide if Empty' (or set this as a component wide default setting which can be overridden at the field level)

and as an expansion, add to a fly brick

'Hide if all fields are empty'

Thanks
Morgan Leecy MCSE

Novell / Linux
PHP. MYSQL, Apache, node.js
Coldfusion, JQuery, HTML5
Joomla

Please Log in or Create an account to join the conversation.

Hide if empty 03 Jan 2017 20:18 #14900

For now, fields in an exploded view you can test $field->value:
	<?php
	// kids
	$field = $fieldSet['jform_count'];
	if (($field->value > 0)) :
	?>
	<div class="control-group <?php echo 'field-' . $field->id . $field->responsive; ?>">
		<div class="control-label">
			<?php echo $field->label; ?>
		</div>

		<div class="controls">
			<?php echo $field->input; ?>
		</div>
	</div>
	<?php endif ?>
My only question is; how will you ever load them if they are initially hidden?
:unsure:

Please Log in or Create an account to join the conversation.

Hide if empty 03 Jan 2017 20:20 #14901

  • MorganL
  • MorganL's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 438
  • Thank you received: 53
Sorry this was just a new functionality request, I know a few work arounds but its just boring coding them

Example of why this would help save me time

I have 'optional' fields in an item meta that do not need to be filled out, there are about 30 in total. Thats 30 times I need to wrap a field in an if statement.. whereas a nice tick in a box means its done and dusted and I dont need to FORK / alter
Morgan Leecy MCSE

Novell / Linux
PHP. MYSQL, Apache, node.js
Coldfusion, JQuery, HTML5
Joomla

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.077 seconds

I jumped and started to work on a demo component... but 2 days later this demo component became the real component. I just showed today the end result to my customer and he turned to me and said... "this is more than I expected"... All of this is because Cook did cut about 70% of my work and provided me more ways to improve the usability of the component. The end result was 17 tables all related between than to generate a full dashboard for the travel agents. Thanks for Cook developers for such great tool. This component would not be possible to be done at short time with all the features in it
Griiettner (Forum)  

Get Started