I've created a page view that contains exposed search fields on date, so my site visitors can search the View output by date and click APPLY and then get just a set of results for those dates.
This works.
I also have the Views Bonus Pack installed and I have a CSV feed attached to this page. The CSV exports but it always exports all of the View's data and not just the results of my exposed filter search. The weird thing is that the feed path does appear to pick up the arguments based on the View page exposed filters, but it still exports all of the data for the View and not just those specific results.
So basically both View attachments work - the Feed exports to CSV and the page displays output, but the feed always exports all of the Views output regardless of the search filter results.
Does anyone have suggestions on how to make this work with Views Bonus Pack/Views 2 and Drupal 6? There's another post here on this topic but unfortunately not a really detailed solution:
Any suggestions?
-backdrifting
Comments
Possible in D6/ Views Bonus Pack?
Additionally I think this used to be possible in Drupal 5 with arguments. I recall there was a method of applying an Argument to use a CSV File selector. But I don't see this argument in Views 2 and Drupal 6.
Here are the paths:
Default feed path for CSV export: submitted_feed?attach=page_1
When I apply the exposed filter search for a date (for example) I get this when hovering over the CSV icon:
submitted_feed?date_filter[value][date]=2010-06-09&date_filter_1[value][date]=2010-06-09&attach=page_1
So this should only return results in the CSV for 6-9-10, but it actually returns all results.
Suggestions?
-backdrifting
_
Yep it's possible and I do it all the time. I'm not sure I did anything special to get it to work-- i created a page display at 'page_display_path' with exposed filters, then set the feed/csv path to be '/page_display_path/csv', and set the 'Attach to' setting to be the page display with the exposed filters.
Path tweaks work ... thanks
Sweet! Works. So it's all in how you have the paths constructed. Thanks for the heads up on that. I used your /csv method in the path and now it's working.
Great.
Best-
backdrifting
_
good to know-- I didn't know it had to be that way, it just so happened that's how I set it up, lol.
I found that with Views
I found that with Views 6.x-2.10 and Views Bonus 6.x-1.0 that it wasn't a matching path that mattered, it was having the same exposed filters in the same order.
Views Settings
I was having the same problem with exposed filters not being accounted for in the CSV. I found these settings worked:
- make sure all filters are the same in the page view and the XLS Feed view
- make sure the exposed filters from the page view are also exposed in the XLS Feed view
- make sure all of the settings for the exposed filters such as 'Filter identifier' are identical in the page view and XLS Feed view
Verifying the last two settings is what made the difference for me.
Thanks!
Didn't realize I needed the Data Export display filters to exactly match the block display with the exposed filter. Once I did that, and made sure the filter indentifiers matched, it worked.
Export a view with exposed filters for dates.
I also had to export a view after filtering the nodes by dates.
The attached feed/csv export will not pick up the filters from the attached view.
What I did was add some PHP code in the header that parses the URL string to create a link to send the correct arguments to the export view.
You must turn off AJAX so the query string appears in the url after filtering. Also remember to enable the PHP input filter and set the header to PHP.
In this code, I am picking up 2 filters, one for the posted date and one for the most recent revision date.
~are you netsperienced?
♥ follow me @decibelplaces ∞
csv export of view with exposed date popup filters
I tried the path setup suggested by WorldFallz but the csv button still exports the entire unfiltered view
I switched from select filters to popups which create a different URL syntax, here is some code for popup filters:
~are you netsperienced?
♥ follow me @decibelplaces ∞
Make Sure the Page View and Feed View are Close to Identical
I had to make the BOTH the fields and the filters of the Page view match the Feeds view exactly. Fortunately, I was able to go into the fields that I wanted to hide in the Page view but not in the Feeds view by simply selecting "Exclude ffrom display" for each field.
---- Correction: Having the fields be the same is not necessary. The reason mine was not working was because I changed the CSV feed icon on my page, thereby preventing the arguments from passing to that feed page when clicked. Now I am back to the default icon and the feed button is working great with exposed filters from my page view.