0

Drupal 8: how to add a custom action button to download all users in custom CSV, A general button anywhere . ( see the capture )

Screen admin view users

tafokt
  • 1
  • 1

1 Answers1

0

If you install the views data export module (https://www.drupal.org/project/views_data_export), you can then edit the View which controls the user listing and add a CSV export as an additional display, and attach it to the page display.

  • I just want to add a simple "export info" link next to the filter for example, which executes a custom route and I'll do the custom code to generate the export. do you have an idea how to add this link in the display at the top of the table? – tafokt Aug 04 '20 at 11:24
  • @tafokt That's how I'd approach it, as I've outlined above. Using the module means you don't need to code your own export. Download the module and add it to your codebase in modules/contrib. Enable it under the Extend menu item in the Drupal CMS, then go to to the admin/people view (structure -> views in the Drupal admin menu). You can then add a display to the View, attach it to the default page display, and you'll get a button plus all the export functionality done for you. – Kat Elliott Aug 05 '20 at 21:06