Differences

This shows you the differences between two versions of the page.

Link to this comparison view

documentation:white-pages:latest:config_csv [2018/04/09 16:32] (current)
Line 1: Line 1:
 +====== CSV export ======
 +
 +<​note>​Configuration file: use [[config_general#​configuration_files|White-Pages'​ local configuration file]]</​note>​
 +
 +When using the advanced search form, it is possible to export results in a CSV file instead of displaying them. If the feature is activated, a new input button is displayed under the form.
 +
 +===== Activation =====
 +
 +Enable or disable this feature:
 +<file php>
 +$use_csv = true;
 +</​file>​
 +
 +===== File name =====
 +
 +Set the CSV file name:
 +<file php>
 +$csv_filename = "​white_pages_export_"​ . date("​Y-m-d"​) . "​.csv";​
 +</​file>​
 +
 +===== Items =====
 +
 +List the items that will be put in CSV file:
 +<file php>
 +$csv_items = array('​firstname',​ '​lastname',​ '​mail','​organization'​);​
 +</​file>​
 +
 +<note tip>To have same fields between [[config_advanced_search|Advanced search]] menu and CSV export :<file php>​$csv_items = $search_result_items;</​file></​note>​