Modifying the Search Filter Panel (Escenic Back End)
Custom filters are simpler than the predefined filters: they are
simple tests that the
CUE
user can only turn on or off. You could, for example, create a
"Premium content" filter that selects only content items with a
Boolean premium
field that is set to
true
.
To modify the search filter panel:
-
If necessary, switch user to
root
.$
sudo su -
Open
/etc/escenic/cue-web-3.3/40-search-filter.yml
for editing. For example:#
nano/etc/escenic/cue-web-3.3/40-search-filter.yml
-
Modify the default search filter layout to meet your requirements:
searchFilter: - id: "document-types" name: "Document Types" #translate - id: "document-states" name: "Document States" #translate - id: "creation-date" name: "Creation date" #translate - id: "authors" name: "Authors" #translate - id: "sections" name: "Sections" #translate - id: "tags" name: "Tags" #translate
You can, for example, change the order of the predefined filters and remove any you don't need by commenting them out:
searchFilter: - id: "document-types" name: "Document Types" #translate - id: "document-states" name: "Document States" #translate - id: "creation-date" name: "Creation date" #translate - id: "sections" name: "Sections" #translate - id: "authors" name: "Authors" #translate # - id: "tags" # name: "Tags" #translate
You can also add custom filters of your own. You can insert a custom filter anywhere you like, for example:
searchFilter: - id: "document-types" name: "Document Types" #translate - id: "document-states" name: "Document States" #translate - id: "creation-date" name: "Creation date" #translate - id: "premium-content" name: "Premium Content" #translate query: "premium_b:true" - id: "sections" name: "Sections" #translate - id: "authors" name: "Authors" #translate # - id: "tags" # name: "Tags" #translate
-
Save the file.
-
Enter:
#
dpkg-reconfigure cue-web-3.3This reconfigures CUE with the changes you have made.
Note the following:
-
A custom filter's
query
property of must contain a valid Solr query clause. This means that in order to write such a clause you need to know both Solr query syntax and your Solr schema (in order to know what fields are indexed and how to identify the fields correctly). -
The predefined search filters have fixed IDs. Make sure that your custom filter IDs do not clash with them.