Kook VIP
Total posts: 6
11 Авг 2014 03:43

Hi, I am looking to export a full list of all records within a section (this section only contains a single category, so even a single category would be great) to CSV. I can use the CSV Formatter and get out a CSV of the first 20 rows from the section, this doesn't really allow me to export the additional columns from the full description area, just the columns in the introduction at the moment. I also can't seem to get around pagination. I would like to keep pagination as it is at 20 records per page for the template displayed to the public however for a CSV export I'd much rather the whole lot at once if thats possible.

I know I could setup a temporary list containing the columns I need and then change pagination to 100 per page to get them out that way however I currently have over 2 thousand records so I would need to do that 20+ times, and also need to have the site in a pretty messy state for my users while the export is taking place. Ideally I'm looking to create an export option so that any Super Administrator level user can export the full section list whenever they like without affecting the public side at all.

I've discovered the Module Records this really ticks most of the boxes allowing me to assign it to an override template, the only thing I can't get around is the pagination, removing it entirely so that all records are displayed.

I've attempted to set the Default Records per page to a high number, removing pagination on the override template this removes the pagination drop down but doesn't display all records.

Even if there is a way to achieve this by hardcoding within the override template, from what I can see though I only have access to the first 20 records and only the fields within the list view rather than the full details view.


Sergey
Total posts: 13,748
11 Авг 2014 07:30

Just add to your URL &limit=500. But do not expect good perfomance.


Kook VIP
Total posts: 6
11 Авг 2014 08:07

Your work is nothing short of fantastic, thanks a ton. Speed isn't an issue as it will only be run by super admins occasionally. Is there any trick to getting items from full details to appear in a custom template list as well? If not I can just get them to check the checkboxes in the fields area as I know that will function well enough for their purposes.


Sergey
Total posts: 13,748
11 Авг 2014 11:09

There are ways around this.

  1. You allow fields in article description but you excllude them in template parameters. Some templates has it.
  2. You create custom CSV plugin template where you access fields values through $item->fields rather than through $items->fields_by_id[]->result;
Работает на Cobalt