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.073 seconds
  I still don't believe he can really be human to do all this ! From all of the forums that I've ever participated in this is certainly the one that most encapsulates the feeling of being truly open source where everyone's opinions and contributions can and will shape the development of the service! It's truly awesome! Hope you enjoy cooking and look forward to reading and contributing to any of the editorial work that you proposed too!! Thanks
Gez (audibleid - JED)

Get Started