Problem/Motivation

With #3244450: Adding title to attached export icons from Views data export the export_icon theme template gained a new variable #title.

This variable is not used by default but can be used in custom theme templates.

It is not set in ExcelExport as it is set in DataExport.

Steps to reproduce

  • Use xls_serialization for multiple views.
  • Try to differentiate the rendered export link between views in a custom view.
  • Notice that there is no easy way to just output the view display title.

Proposed resolution

Set '#title' => $title in ExcelExport as in DataExport.

Remaining tasks

  • Implement solution

User interface changes

None.

API changes

None.

Data model changes

None.

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

tgauges created an issue. See original summary.

tgauges’s picture

Title: Set #title of export_icon theme » Set #title of export_icon theme template

tgauges’s picture

Assigned: tgauges » Unassigned
Issue summary: View changes
Status: Active » Needs review

I implemented the simple solution: !62

I did not find a test for \Drupal\xls_serialization\Plugin\views\style\ExcelExport::attachTo. Should there be one?

mably’s picture

@tgauges have you given a try to the new Views Data Export Excel module?

This might also be a solution to your problem.

It was created after this issue: #3560297: Style plugin attachTo() not being invoked

mably’s picture

Status: Needs review » Fixed

Looks like a no brainer to me, merging.

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.

  • mably committed 913e5d47 on 2.1.x authored by tgauges
    feat: #3572607 Set #title of export_icon theme template
    
    By: tgauges
    
tgauges’s picture

Status: Fixed » Needs review

@mably Thank you.

I did not try views_data_export_excel yet, but I will. It seems like a cleaner solution.

tgauges’s picture

Status: Needs review » Fixed

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.