Location Search Macro

Last modified by Admin on 2024/07/05 18:17

cogWiki macro using a reference given as parameter to trigger search with the location pre-filled
TypeXAR
CategoryOther
Developed by

Raluca Stavro

Active Installs0
Rating
1 Votes
LicenseGNU Lesser General Public License 2.1

Installable with the Extension Manager

Description

Easily search:

  • specific kinds of elements (documents, comments, attachments, …)
  • in specific locations
  • with specific tags
  • with specific object types

To use the macro, you can use the following syntax when in wiki edition mode:

{{locationSearch reference="Sandbox.WebHome" box="true" float="true" placeholder="My placeholder ..." width="400px" inputWidth="60%" buttonWidth="37%" buttonText="My button text" description="My description text that should explain how to search the elements in this location." /}}

With the following result:

LocationSearchMacro.png

Here's how the suggestions look:

location-search-suggest.png

Full parameter list:

Narameter name Description Example Mandatory Default value
 reference      Restrict search to this location. Takes a document reference  MySpace.WebHome  No  WebHome (since version 1.4; searches in the current document sub tree by default, use the empty string to search everywhere)
 box            Display the search field in a box  true  No  false
 float          Make the search field float  true  No  false
 placeholder    Customize the placeholder displayed in the search input  Search…  No  the translated "panels.search.inputText" string
 buttonText     Customize the text of the search button  No  the traslated "search" string
 width          The size of the search box, in CSS  100%  false  (empty)
 inputWidth     The size of the input, in CSS  15em  false  (empty)
 buttonWidth    The size of the button, in CSS  5em  false  (empty)
 description    a description that will be shown to explain what the search field does  Search this space for documents with the meeting and notes label  No  (empty)
 tags          Restrict search to this comma-separated list of tags  meetings,notes  No  (empty)
 className     Restrict search to documents containing objects of this type  Blog.BlogPostClass  No  (empty)
 kind  Search in the specified kind of element, among "title", "content", "comment", "attachmentName", "attachmentContent",  "attachment" (which is a shorthand for the two previous options), "object", "all". Note: this is different from the "type" field in Solr, hence the different name. The Solr type is always DOCUMENT, in order to be able to apply the different search restrictions specified using the relevant parameters.  attachment  No  all
 suggest  Whether to suggest results while typing a search string.  false  No  true
 showExcerpts  Whether to show excerpts in which matches are highlighted with suggested result. Only relevant if suggest is not set to false.  false  No  true 

Release Notes

All release notes

1.4.1

1.4

1.3

1.2

Prerequisites & Installation Instructions

We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager). Note that installing Extensions when being offline is currently not supported and you'd need to use some complex manual method.

You can also use the following manual method, which is useful if this extension cannot be installed with the Extension Manager or if you're using an old version of XWiki that doesn't have the Extension Manager:

  1. Log in the wiki with a user having Administration rights
  2. Go to the Administration page and select the Import category
  3. Follow the on-screen instructions to upload the downloaded XAR
  4. Click on the uploaded XAR and follow the instructions
  5. You'll also need to install all dependent Extensions that are not already installed in your wiki

Get Connected