How to programmatically trigger an export from a content page?

Created on 2 July 2024, 9 months ago

Problem/Motivation

I have a view with exposed fields and an excel export button attached to it. Users can search and narrow down the results, and then export the results. This works fine but I wonder is there a way to attach the export button to a single content display (for example a single Product), so that the user can export a single item using the same configuration?

💬 Support request
Status

Active

Version

1.4

Component

Code

Created by

🇯🇵Japan hktang

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @hktang
  • Status changed to Fixed 4 months ago
  • 🇬🇧United Kingdom steven jones

    Sure, so you could potentially add a Contextual Filter to your export view that would filter on the entity ID of the thing you want to export.
    Then construct and render a link to the export view display with an extra path segment on the end of the URL that's your entity ID.
    That should then export just that single entity.

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

  • 🇯🇵Japan hktang

    Thank you. I will give it a try!

Production build 0.71.5 2024