Closed (fixed)
Project:
Views data export
Version:
6.x-2.0-beta5
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
9 Dec 2011 at 22:50 UTC
Updated:
11 Jun 2013 at 18:00 UTC
Hello,
Thank you for this module. It's very useful. I used this to add an export .csv button to a custom search using views exposed filters. The search and export work well, however, we do not wish to allow data export if all exposed filters are empty as this would show all the data in the database tables. Is it possible to hide the .csv button if all exposed filters are empty?
Mark
Comments
Comment #1
jvdurme commentedJust found how to do this. Edit your view and click on Theme:Information in the Style Settings box. Then you see "Display Output" at the top of the list and a few filenames after that. Click on "Display output" and copy and paste the php code you see there into a new file with the filename that is listed last after "Display output".
Place this file in your active theme directory.
Then click on the button "Rescan template files" in the view edit theme information section. That filename should now be in bold, meaning it's being used.
Views will now use that file to display the view and you can modify this to add an if clause for displaying the feed/csv icon, as show below in this code.
I just took a hard coded integer for all rows, but modify it to meet your demands. Or use another available variable as listed at the beginning of the code.
Comment #2
steven jones commented