Skip to content

Instantly share code, notes, and snippets.

@CreativePoweredGeek
Created January 11, 2020 12:45
Show Gist options
  • Save CreativePoweredGeek/70a0f95c64a54212df10f7b9bc3461b2 to your computer and use it in GitHub Desktop.
Save CreativePoweredGeek/70a0f95c64a54212df10f7b9bc3461b2 to your computer and use it in GitHub Desktop.
Simple Export to File
{exp:http_header
content_disposition="attachment"
filename="myfile.xls"
content_type="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
}
<table>
<thead>
<tr>
<th>Entry ID</th>
<th>Title</th>
<th>Author</th>
<th>Created</th>
<th>Updated</th>
<th>Status</th>
<th>Tool File</th>
<th>Tool URL</th>
</tr>
</thead>
<tbody>
{exp:channel:entries
channel="tools"
disable="category_fields|member_data|pagination"
dynamic="no"
limit="999"
}
<tr>
<td>{entry_id}</td>
<td>{title}</td>
<td>{author}</td>
<td>{entry_date format="%Y-%m-%d-%H:%i"}</td>
<td>{edit_date format="%Y-%m-%d-%H:%i"}</td>
<td>{status}</td>
<td>{tool_file}</td>
<td>{tool_url}</td>
</tr>
{/exp:channel:entries}
</tbody>
</table>
@CreativePoweredGeek
Copy link
Author

This sample was pulled from StackExchange and posted by Alex Kendrick in 2015.
It requires the http header plugin be active in the Add-Ons panel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment