When working on complex Views, especially when making use of things like the customfield module, sometimes you end up with a number of fields which are set 'exclude from display'. It would be very helpful if there was some sort of visual indication of which fields are hidden in this way when working on the View as it can become a bit confusing if a View is being maintained by multiple people or when going back in to tweak a View that you haven't worked on in awhile.

While something of a separate issue, it would also be really cool to be able to put an internal description on individual fields so that they can be documented within the UI itself.

Comments

dawehner’s picture

Do you have any suggestions how this should be marked? Greyed out is already used by inheritance of settings. Perhaps there should be a * in Front or similar

drawk’s picture

Yeah, greyed out seems off limits given that it is used as a visual cue for inheritance. I'd be fine with any sort of visual indication ('*' would work) or it could be images like in Photoshop when a layer is hidden / turned off.

dawehner’s picture

I never used photoshop :) Can you provide a screenshot?

drawk’s picture

I try to avoid using Photoshop as much as possible, but grabbed this from the web :) Notice the eye icons to the left of the layers - clicking on one of these disables the display of that layer and removes the eye icon so that you can see at a glance that it is disabled.

Another things i noticed though is that the 'greyed out' look seems to be just for the labels of inherited fields. The actual fields themselves seem to use italics to show inheritance - so they could probably still be shown in a lighter shade to indicate being excluded from display.

drawk’s picture

StatusFileSize
new40.52 KB

Oops, forgot to attach the PS screenshot

drawk’s picture

Status: Active » Needs review
StatusFileSize
new1.5 KB

Here's a patch that adds a class to excluded fields so that one can at least identify them and do what they would like to do via js or css

dawehner’s picture

Status: Needs review » Needs work

I would suggest to add the "exclude" class to $field['class']

Then the tpl looks much cleaner.

drawk’s picture

Status: Needs work » Needs review

Seems reasonable, although I was thinking along the lines of:
- keeping it consistent with the way 'changed' is handled
and
- it may be beneficial to be able to determine if the field is excluded from within the tpl (ie. by checking $field['exclude']) in the same way it is handy to be able to check $field['changed'] or $field['title'], etc..

I'm not all that familiar with Views internals, but I thought that $field['class'] as set in admin.inc is meant to be the single 'bigger picture' identifier (displayid-type-id)

I'm not married to any particular approach though, so if still feel that appending it to $field['class'] is the way to go, I'd be happy to re-roll the patch.

Thanks!

drawk’s picture

As far as visual indicators go, I'm beginning to lean towards parenthesis. ie:

Fields
Node: Title title
(Node: Type type)
Node: New Comments comments

Would be a View where the 'type' field is hidden / excluded

Thoughts?

drawk’s picture

StatusFileSize
new88.59 KB

Screenshot with parens

drawk’s picture

StatusFileSize
new104.16 KB

Another screenshot, this time looking at the 'Page' display with inherited fields

jolidog’s picture

StatusFileSize
new6.72 KB

I thing an image is not needed, your previous suggestion with the parenthesis is good, but why not just adding (Excluded) to the field title?

Fields
Node: Title title
Node: Type type (Excluded)
Node: New Comments comments

and style the "(excluded)" with style="color:red", or add a class such as excluded or excluded-field and style a span element accordingly.
Added a simulation made with firebug.

jolidog’s picture

hum, but then we would need to have the "Excluded" text translatable....

drawk’s picture

Could we not just pipe it through t()?

drawk’s picture

StatusFileSize
new2.47 KB

Here's the patch with the parens - I'm equally open to Jolidog's suggestion as well if we can get consensus.

dawehner’s picture

Status: Needs review » Needs work
+                        if (!empty($field['changed'])) { print ' changed'; }
+                        if ($field['exclude']) { print ' excluded'; }

Can we move this logic to the preprocess? This would clean up the code a big

iantresman’s picture

I was just thinking how useful this would be, myself. Since UI real estate is in short supply, perhaps showing the word "Excluded" takes up too much space when fields names are long. Perhaps a symbol would be sufficient, with a pop-up tooltip for details, eg:

Fields
   Node: Title
X  Node: Teaser
   Customfield: PHP code
XR Content: Science 9999
   Content: Issue Default
   Content: Issue year 9999

Then hovvering the cursor over "X" would show "Excluded from display", over "R" would show "Rewritten field", etc.

tim.plunkett’s picture

Status: Needs work » Closed (duplicate)