Differences

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

Link to this comparison view

documentation:white-pages:latest:config_entries_display [2018/04/18 14:42] (current)
Line 1: Line 1:
 +====== Entries display ======
  
 +<​note>​Configuration file: use [[config_general#​configuration_files|White-Pages'​ local configuration file]]</​note>​
 +
 +===== Display mode =====
 +
 +Set which mode is used to display results when doing a [[config_quick_search|quick search]] or an [[config_advanced_search|advanced search]]:
 +<file php>
 +$results_display_mode = "​boxes"; ​ // boxes or table
 +</​file>​
 +
 +<note important>​This parameter doesn'​t change display of [[config_directory|Directory (table)]] and [[config_gallery|Gallery (boxes)]] menus.</​note>​
 +
 +When displaying search results with ''​table''​ mode, columns are made from : 
 +  * ''​$search_result_title''​ and ''​$search_result_items''​ for users
 +  * ''​$search_result_title''​ and ''​$search_result_group_items''​ for groups
 +
 +==== DataTables ====
 +
 +[[https://​datatables.net/​|DataTables plugin]] is used to sort, paginate, filter and print results returned by [[config_quick_search|Quick search]], [[config_advanced_search|Advanced search]] and [[config_directory|Directory menu]].
 +
 +=== Activation ===
 +
 +Enable or disable the DataTables JS component in application:​
 +<file php>
 +$use_datatables = true;
 +</​file>​
 +
 +=== Configuration ===
 +
 +Define pagination values in dropdown:
 +<file php>
 +$datatables_page_length_choices = array(10, 25, 50, 100, -1); // -1 means All
 +</​file>​
 +
 +Set default pagination for results (can also be used to force the length without ''​$datatables_page_length_choices''​):​
 +<file php>
 +$datatables_page_length_default = 10;
 +</​file>​
 +
 +Enable or disable [[https://​datatables.net/​extensions/​buttons/​examples/​print/​autoPrint|autoPrint]] feature:
 +<file php>
 +$datatables_auto_print = true;
 +</​file>​
 +
 +===== Display results =====
 +
 +List which items are shown in result box or in result table:
 +<file php>
 +// for users
 +$search_result_items = array('​mail',​ '​phone',​ '​mobile'​);​
 +
 +// for groups
 +$search_result_group_items = array('​fullname','​description'​);​
 +</​file>​
 +
 +<​note>​The items identifiers are those defined in [[.:​config_attributes|attributes map]]</​note>​
 +
 +Set which item is used as result box title or as first column in result table:
 +<file php>
 +$search_result_title = "​fullname";​
 +</​file>​
 +
 +Set on which item results are sorted:
 +<file php>
 +$search_result_sortby = "​lastname";​
 +</​file>​
 +
 +List which items are clickable in result (can also be a boolean value):
 +<file php>// Other possible values :
 +// true if you want the whole row clickable ; 
 +// false do the same and hide the button in the first column.
 +$search_result_linkto = array("​fullname"​);​
 +</​file>​
 +
 +Display or not undefined values:
 +<file php>
 +$search_result_show_undefined = true;
 +</​file>​
 +
 +Define [[http://​getbootstrap.com/​css/#​grid|bootstrap]] column class:
 +<file php>
 +$search_result_bootstrap_column_class = "​col-md-4";​
 +</​file>​
 +
 +Truncate values to fit in result box:
 +<file php>
 +$search_result_truncate_value_after = "​20";​
 +</​file>​
 +
 +Truncate title to fit in box head:
 +<file php>
 +$search_result_truncate_title_after = "​30";​
 +</​file>​