Jump to content

Help:WSSearchFront: Difference between revisions

From mediawiki.org
Content deleted Content added
No edit summary
No edit summary
Line 89: Line 89:
|title=Title
|title=Title
<nowiki>#</nowiki>highlight=true
<nowiki>#</nowiki>highlight=true

<nowiki>#</nowiki>urlstring=search
|property that will be used for the search results title and link
|property that will be used for the search results title and link






Line 96: Line 100:
'''#highlight''' setting highlights the search term in the title
'''#highlight''' setting highlights the search term in the title


'''#urlstring''' add url parameters to the link href
'''#urlstring''' adds search terms as an url parameter named by the value to the link href
|-
|-
|sort options
|sort options
Line 116: Line 120:
|if set, the 'clear all filters' button also clears the search term
|if set, the 'clear all filters' button also clears the search term
|}
|}


size=<code>&#x3C;number&#x3E;</code> // amount of results per page title=<code>&#x3C;property&#x3E;</code> // property to use as link title

optional title setting: <code>#label=&#x3C;text&#x3E;</code> <code>#highlight=true</code> //adds highlights to result title <code>#urlstring=&#x3C;urlparam&#x3E;</code> //adds search terms to result href

layout=table //optional, show results in table layout clear=term //optional, remove search term when clearing filters sort=<code>&#x3C;property&#x3E;</code> //optional, property to sort results by sort options=Title, Version //optional, shows a dropdown with sort options size options=<number>, <number> //optional , shows a dropdown with size options


=== Search result settings ===
=== Search result settings ===
{| class="wikitable"
{| class="wikitable"
|+
|+
!parameter
!
!values
!
!settings
!
!example
!
!description
|-
|-
|
|
|
|
|
Line 137: Line 136:
|
|
|-
|-
|
|
|
|
|
Line 142: Line 142:
|
|
|-
|-
|
|
|
|
|

Revision as of 12:20, 27 August 2021

The WSSearchFront extension is a front-end for WSSearch written in Vue.js

Configuration

The WSSearchFront extension must be configured using the WSSearchFrontend parser function


Example configuration:

{{#WSSearchFrontend:
|size=10
|clear=term
|sort options=Title, Version
|title=Version
    #label=Label for table
    #highlight=true
    #urlstring=search
|layout=table
|@Title
    #display=ask combobox
    #query=[[Class::+]]
    #data=Title
    #text=name
    #search=true
|@Service
    #translation=Name
    #query=[[Class::Service]]
|@Version
    #display=combobox
|@Dictum
    #logic=or
    #sort=alphabetically
|@Modification date
    #display=datepicker
    #label=Date
|@Rating
    #display=range
      #max=5
    #step=1
|@Year
  #display=range
  #max=20
  #type=date
|?Version
|?Class
    #label=Page type
    #display=pill
    #highlight=true
    #logic=or
|?Users
    #display=link
|?Image
    #display=image
    #label=Page image
|?Rating
    #display=template
    #template=Special rating
}}

Available configuration options

settings

parameter values #settings example description
size <number> size=10 defines how many results are shown per page
size options <number>, <number> size options=10, 20, 50 if set a drop-down with the defined size options will be shown
title <property> #label

#highlight

#urlstring

title=Title

#highlight=true

#urlstring=search

property that will be used for the search results title and link



#label setting is only for table layout

#highlight setting highlights the search term in the title

#urlstring adds search terms as an url parameter named by the value to the link href

sort options <property>, <text>:property> sort options=Version, Page name:Title if set a drop-down with sort options will be shown, default results will be sorted by relevance, optional a label for the property to sort on can be set by adding text before the property devised by :
layout table layout=table changes the layout for the search results to a table
clear term clear=term if set, the 'clear all filters' button also clears the search term

Search result settings

parameter values settings example description
?<property>
`#display=<option>`  // optional, options: image, link, pill or template
`#label=<text>`      // optional
`#highlight=true`    // optional

for display template add #template=<template> template, passes and to the template

Facets filter settings

@<property>
`#display=<option>`    // optional
options: datepicker, search, combobox, ask combobox or range
`#label=<text>`        // optional
`#logic=or`            // optional (needs 'post filter properties' setting in back-end WSSearchConfig)
`#sort=alphabetically` // optional    

for display range add #max=<number> and #step=<number>

for display ask combobox add #query=<ask> // the ask query example Class::Page #data=<property> // property for data #text=<property> // optional, property for display #search=true // optional, search on enter key

facet translations

 `#translation=<property>` // optional, translate property of type page
 `#query=<ask>`      // required for translation, the ask query example [[Class::Page]]