Hi!
Any way to hide labels for empty values? Checkbox 'Hide if empty' isn't work.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | hide-empty.patch | 1.14 KB | powysm |
| #6 | hide-if-empty.patch | 1.07 KB | internal |
Hi!
Any way to hide labels for empty values? Checkbox 'Hide if empty' isn't work.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | hide-empty.patch | 1.14 KB | powysm |
| #6 | hide-if-empty.patch | 1.07 KB | internal |
Comments
Comment #1
dmizrahi commentedHello,
If the field is null it works, but if there is an empty string the field is shown. I don't know if it's on purpose or not.
What is your need in this case ?
If you know a little PHP, you can look at line 41 of the /includes/views/views_display_plugin_services.inc
if (isset($item->{$field->field_alias})) {Isset check if it exist (not null) and not if its empty.
Comment #2
UksusoFF commentedwhy field_alias? why not value?
Comment #3
dmizrahi commentedit's $item->field_alias, and item is the view result. So item handle the value and need the alias of the field. Anyway, this line is the value check.
Comment #4
powysm commentedI am a little confused here on the comments.
I have a service view which is pulling back several custom content types which have different fields. So i add all the fields required, this then means each instance of the various content types get a field for all those listed even if they are not relevant to that content type and therefore have no content(value). These are then displayed as empty arrays. checking Hide empty does not resolve this. Based on what dmizrahi has said it sounds like it should?
Comment #5
dmizrahi commentedI don't work on this anymore but if you know some php, go in the source code and change it to match your requirement.
There are no mainteners for this module anymore.
I think you have to change how the test on hide_empty is managed.
Sorry i can't help you more.
Comment #6
internal commentedThere is the patch for that.
Comment #7
emerham commentedpatch not working.
Working on one, but having issue hiding only fields that don't have content with the "hide_empty" option set for a field.
Also trying to get rewrite if empty working
Comment #8
powysm commentedIn case it helps someone, this is doing the cleanup for me
Comment #10
generalredneckModified #8 a bit and committed. Rewrite results seem to not work very well period, so that might be a new thing to worry about.