(*: website_blog, website_event, website_forum, website_sale, website_slides) Before this commit the search bar was specific to products. After this commit a generic search bar is available as a general feature of website which can be configured to inspect specific models. The snippet is used to replace the old search bar in blog, courses, event, forum, page and shop. The search results of these pages and the autocomplete of the search bar run through the same search mechanism. A new hybrid results page has also been created as a target of a search on "Everything". In each involved module, `website._search_get_details()` is implemented to return search metadata for every model related to the `search_type` parameter. Search metadata for a single model is returned by `_search_get_detail()` on that specific model. The autocomplete runs through the additional `website._search_render_results()` pre-rendering step that prepares the data to fit in the autocomplete template. task-2379555 https://github.com/odoo/odoo/pull/65871 Part-of: odoo/odoo#65871
22 lines
1.6 KiB
XML
22 lines
1.6 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
|
|
<!-- Snippets and options -->
|
|
<template id="slide_searchbar_input_snippet_options" inherit_id="website.searchbar_input_snippet_options" name="slide search bar snippet options">
|
|
<xpath expr="//div[@data-js='SearchBar']/we-select[@data-name='scope_opt']" position="inside">
|
|
<we-button data-set-search-type="slides" data-select-data-attribute="slides" data-name="search_slides_opt" data-form-action="/slides/all">Courses</we-button>
|
|
</xpath>
|
|
<xpath expr="//div[@data-js='SearchBar']/we-select[@data-name='order_opt']" position="inside">
|
|
<we-button data-set-order-by="slide_last_update asc" data-select-data-attribute="slide_last_update asc" data-dependencies="search_slides_opt" data-name="order_slide_last_update_asc_opt">Date (old to new)</we-button>
|
|
<we-button data-set-order-by="slide_last_update desc" data-select-data-attribute="slide_last_update desc" data-dependencies="search_slides_opt" data-name="order_slide_last_update_desc_opt">Date (new to old)</we-button>
|
|
</xpath>
|
|
<xpath expr="//div[@data-js='SearchBar']/div[@data-dependencies='limit_opt']" position="inside">
|
|
<we-checkbox string="Description" data-dependencies="search_slides_opt" data-select-data-attribute="true" data-attribute-name="displayDescription"
|
|
data-apply-to=".search-query"/>
|
|
<we-checkbox string="Publication Date" data-dependencies="search_slides_opt" data-select-data-attribute="true" data-attribute-name="displayDetail"
|
|
data-apply-to=".search-query"/>
|
|
</xpath>
|
|
</template>
|
|
|
|
</odoo>
|