Export Asset Listing as a CSV


#1

Hello

I have configured an asset listing page where it downloads a csv file instead.
it seems working however the asset field is all in one straight line in CSV.

this is what I used in Type formats
%asset_name%,%asset_children^count%, %begin_asset_children^count^gte:1%Connected%else_asset%Not Connected%end_asset%,%globals_date_d%-%globals_date_m%-%globals_date_Y%,

and in page contents
%asset_list%

how do I set this so each asset appear as a new line of CSV?

Thanks


(Nic Hubbard) #2

Did you apply a Design with content type?

1. <MySource_PRINT id_name="__global__" var="content_type" content_type="application/excel" />
2. <MySource_area id_name="body" design_area="body" />

#3

hey Nic

I have used below, will try your method to see if it makes any difference, cheers

<MySource_PRINT id_name=“global” var=“content_type” content_type=“text/csv” />
<MySource_AREA id_name=“page_body” design_area=“body” />
<MySource_PRINT id_name=“global” var=“content_attachment” extension=“csv” />


(Martin McErlain) #4

If there is a comma after the last item you have to remove that and then where that comma was hit enter to create a new line so %globals_date_d%-%globals_date_m%-%globals_date_Y%, becomes
%globals_date_d%-%globals_date_m%-%globals_date_Y%

Try that


#5

that worked, I must have accidently removed the new line when inserting a new field!