It would be cool to hide a full column if each row has an empty output.

Some use cases would be node edit/delete links.
I think this could be an option on the table style, but has to be configured to be disabled by default.

Files: 
CommentFileSizeAuthor
#11 1135002-hide-empty_column_6.x-2-x_0.patch2.58 KBJohn Franklin
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 1135002-hide-empty_column_6.x-2-x_0.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#6 1135002-hide-empty_column.patch2.71 KBbojanz
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 1135002-hide-empty_column_0.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#4 1135002-hide-empty_column.patch2.65 KBdawehner
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 1135002-hide-empty_column.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Comments

Hydra’s picture

this would be a great feature!

areikiera’s picture

+1 subscribe

Hydra’s picture

As long as this feature isn't part of views 3 the #1 solution in #313551: Add Ability to Hide Empty "Edit link" Table Column works for me!

dawehner’s picture

Status:Active» Needs review
StatusFileSize
new2.65 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 1135002-hide-empty_column.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

The space available in the table setting seems to be too much, if this field is added.

Here is a patch for the feature itself, it works fine already.

bojanz’s picture

Code looks code and works as advertised.
My only nitpick is that "Hide empty column" is not centered (the checkboxes are not in the middle like for "Sortable"), even though the patch specifies the correct align..

bojanz’s picture

Status:Needs review» Reviewed & tested by the community
StatusFileSize
new2.71 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 1135002-hide-empty_column_0.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Made it centered. I'm gonna go ahead and mark this as RTBC.

dawehner’s picture

Version:7.x-3.x-dev» 6.x-3.x-dev
Status:Reviewed & tested by the community» Patch (to be ported)

OMG someone tests/reviews patches :) Huge kudos for this.
Commited to 7.x-3.x

This might be worth to backport to 6.x-3.x

prasannah.ganeshan’s picture

has this been implemented into Drupal 7 yet. I need this really desperately.

bojanz’s picture

@prasannah.ganeshan
It's in 7.x-3.x-dev, as reading comment #7 would have told you.

healycn’s picture

subscribe

John Franklin’s picture

Version:6.x-3.x-dev» 6.x-2.x-dev
Status:Patch (to be ported)» Needs review
StatusFileSize
new2.58 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 1135002-hide-empty_column_6.x-2-x_0.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Here is a patch that applies against 6.x-2.16. (Why this version? 'Cause it's what I needed.) The previous patch applied with some offsets and fuzz. One hunk failed (includes/admin.inc #2), but I couldn't tell you why. It looked clean to me and applying it by hand was trivial enough.

dawehner’s picture

Version:6.x-2.x-dev» 6.x-3.x-dev

This late it doesn't really make sense to commit to 6.x-2.x

John Franklin’s picture

Agreed. The 6.x-2.x version tag makes it clear what that patch was based off of. I wanted to make it available to those of us still running 2.x and in need of this feature, even if it is an unsupported patch.

dreamer777’s picture

I tried the #11 patch for Views 6-2.16, but it does not work. Is there any restrictions when the Views PHP custom field is used?

Status:Needs review» Needs work

The last submitted patch, 1135002-hide-empty_column_6.x-2-x_0.patch, failed testing.

sergiu.popa’s picture

I've applied patch #11 and it works with version 6.x-2.16. Thank you John Franklin

John Franklin’s picture

@dreamer777 -- sorry, I don't use Views PHP, I have no idea.