Chris@0: {# Chris@0: /** Chris@0: * @file Chris@0: * Theme override for displaying a single search result. Chris@0: * Chris@0: * This template renders a single search result. The list of results is Chris@0: * rendered using '#theme' => 'item_list', with suggestions of: Chris@0: * - item_list__search_results__(plugin_id) Chris@0: * - item_list__search_results Chris@0: * Chris@0: * Available variables: Chris@0: * - url: URL of the result. Chris@0: * - title: Title of the result. Chris@0: * - snippet: A small preview of the result. Does not apply to user searches. Chris@0: * - info: String of all the meta information ready for print. Does not apply Chris@0: * to user searches. Chris@0: * - plugin_id: The machine-readable name of the plugin being executed,such Chris@0: * as "node_search" or "user_search". Chris@0: * - title_prefix: Additional output populated by modules, intended to be Chris@0: * displayed in front of the main title tag that appears in the template. Chris@0: * - title_suffix: Additional output populated by modules, intended to be Chris@0: * displayed after the main title tag that appears in the template. Chris@0: * - info_split: Contains same data as info, but split into separate parts. Chris@0: * - info_split.type: Node type (or item type string supplied by module). Chris@0: * - info_split.user: Author of the node linked to users profile. Depends Chris@0: * on permission. Chris@0: * - info_split.date: Last update of the node. Short formatted. Chris@0: * - info_split.comment: Number of comments output as "% comments", % Chris@0: * being the count. (Depends on comment.module). Chris@0: * @todo The info variable needs to be made drillable and each of these sub Chris@0: * items should instead be within info and renamed info.foo, info.bar, etc. Chris@0: * Chris@0: * Other variables: Chris@0: * - title_attributes: HTML attributes for the title. Chris@0: * - content_attributes: HTML attributes for the content. Chris@0: * Chris@0: * Since info_split is keyed, a direct print of the item is possible. Chris@0: * This array does not apply to user searches so it is recommended to check Chris@0: * for its existence before printing. The default keys of 'type', 'user' and Chris@0: * 'date' always exist for node searches. Modules may provide other data. Chris@0: * @code Chris@0: * {% if (info_split.comment) %} Chris@0: * Chris@0: * {{ info_split.comment }} Chris@0: * Chris@0: * {% endif %} Chris@0: * @endcode Chris@0: * Chris@0: * To check for all available data within info_split, use the code below. Chris@0: * @code Chris@0: *
Chris@0:  *     {{ dump(info_split) }}
Chris@0:  *   
Chris@0: * @endcode Chris@0: * Chris@0: * @see template_preprocess_search_result() Chris@0: */ Chris@0: #} Chris@0: {{ attach_library('classy/search-results') }} Chris@0: {{ title_prefix }} Chris@0: Chris@0: {{ title }} Chris@0: Chris@0: {{ title_suffix }} Chris@0:
Chris@0: {% if snippet %} Chris@0: {{ snippet }}

Chris@0: {% endif %} Chris@0: {% if info %} Chris@0:

{{ info }}

Chris@0: {% endif %} Chris@0: