Problem/Motivation

When multiple same-format exports are attached to a view, there is no way to tell them apart except reading the URL.

Proposed resolution

Adding a "title" attribute on the link makes the attached display's title visible to the user when they hover their mouse over the attachment icon.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

samalander created an issue. See original summary.

samalander’s picture

StatusFileSize
new1.66 KB

I've created a merge request on GitLab.

It's my first GitLab MR; just in case I did it wrong, here's also its patch file.

drasgardian’s picture

StatusFileSize
new1.88 KB

Attached patch uses the view display's title rather than name as the text on the link.

svendecabooter made their first commit to this issue’s fork.

svendecabooter’s picture

Version: 8.x-1.0 » 8.x-1.x-dev
Status: Active » Needs review

I have created a new branch / merge request that updates this functionality, by also adding the option to manually set the title via the Views UI - through the Data export style settings.

I used this approach because my Views title gets altered dynamically (via contextual filters), whereas I want the data export icon title to be fixed.

Hope this helps.

The last submitted patch, 3: 3244450-title-export-icons.patch, failed testing. View results

Status: Needs review » Needs work

The last submitted patch, 4: 3244450-title-export-icons-4.patch, failed testing. View results

kala4ek made their first commit to this issue’s fork.

kala4ek’s picture

Status: Needs work » Needs review

Added 2 commits to MR !6 to fix the following issues:

  1. Warning: Undefined array key "link_title" in /src/Plugin/views/display/DataExport.php on line 553
  2. Warning: Undefined array key "link_title" in /src/Plugin/views/style/DataExport.php on line 76
kala4ek’s picture

Adding changes from MR !6 as patch (to have direct link to exatcly that changes).

steven jones’s picture

Status: Needs review » Needs work

YES!!! This would be so cool! Let's get the MR up to date.

steven jones changed the visibility of the branch 3244450-title-export-icons to hidden.

steven jones changed the visibility of the branch 3244450-title-export-icons-with-option to hidden.

steven jones’s picture

Let's focus on MR!6 and let's use the attributes collection to pass in the title, rather than adding a new attribute directly in the template.

steven jones’s picture

pooja saraah’s picture

Addressing the comment #16
setting the title attribute in the #attributes array in PHP, and then using {{ attributes }} in the template.

Attached patch for current version.

moving this issue to needs review.

pooja saraah’s picture

Status: Needs work » Needs review
awearring’s picture

Version: 8.x-1.x-dev » 8.x-1.7

Since 1.7 was release patch #18 (and #12) no longer apply

awearring’s picture

Status: Needs review » Needs work
steven jones’s picture

Version: 8.x-1.7 » 8.x-1.x-dev
Status: Needs work » Needs review

Feature requests should go against the latest dev version.

And I've updated the MR, will try to get this one merged this week.

awearring’s picture

StatusFileSize
new3.65 KB

Updated patch to work with 8.x-1.7

steven jones’s picture

Related issues: +#3553622: Release 8.x-1.8
steven jones’s picture

I've changed slightly the implementation and taken out the custom configuration, I'm not sure we need to have another title, do we?

The patches here had it using an attributes array, and the title was in that, not sure if the approach with moving the title in a preprocess is better/worse, opinions?

@svendecabooter would that suffice for you? You mentioned that the title was being set by contextual filters? But presumably that's optional? You could turn that feature off, can't you?

steven jones’s picture

Status: Needs review » Fixed

Merged.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.