This CSI replaces the [[module Search]] in the search:site page of each wiki. It adds three additional filters:
- title
- author (user)
- category
Below is a mock up (doesn't work). Alternatively, click here to go to a test site.
Instructions
To install this package in your site, create/edit these pages with the following content:
This page | Contains this line |
---|---|
search:site (or define the page)1 | [[include :csi:include:adv-search]] |
Parameters
Parameter | Description | Default Value | Accepted Values |
---|---|---|---|
Customize: | |||
*New* searchLocation |
define where you have placed this CSI (if it wasn't in the search:site page) | search:site | the page in which this CSI is placed in |
text | string for the search button | Search | any string |
css | CSS Code for within the advanced search box | none | CSS Code |
mini | Removes the row of radio buttons | false | true or false |
showTitle | toggles the visibility of the title field | block | none, no, false to hide; block,yes,true to show |
showAuthor | toggles the visibility of the author field | block | none, no, false to hide; block,yes,true to show |
showCategory | toggles the visibility of the category field | block | none, no, false to hide; block,yes,true to show |
hideFilters | hides the entire filters block and overrides existing showXX visibility toggles | false | true or false |
Default values: | |||
defaultTitle | default value for the title field | none | any string (no space) |
defaultAuthor | default value for the author field | none | any string (no space) |
defaultCategory | default value for the category field | none | any string (no space) |
defaultMode | defines the default mode for searching (pages, pages and forum and forum) | pf (pages and forum) | p (pages only) pf (pages and forum) f (forum only) |
Enforce options: | |||
enforceDefault | overrides user-defined filter options (if any) or enforce filter options (if none) for all search results | false | true or false |
enforceMode | overrides user-defined search mode option and enforces the default mode set by defaultMode | false | true or false |
Completely replace the content that is already on the page with [[include :csi:include:adv-search]]
Translate / Alter Labels
In addition to the parameters above, you may use the following to alter the labels displayed in within the search box. This opens the possibility to change the language of the search as well as customizing the text to better suit the site.
Parameter | Default Value | Accepts |
---|---|---|
stringEnforceNote | **Note:** Search result may reload once in order to be displayed. This is normal. | accepts Wiki Syntax |
stringPagesOnly | pages only | accepts HTML tags |
stringPF | pages and forum | accepts HTML tags |
stringForumOnly | forum only | accepts HTML tags |
stringAdditional | Additional Filters: | accepts HTML tags |
stringTitle | Title contains… | accepts HTML tags |
stringAuthor | Author contains… | accepts HTML tags |
stringCategory | Category(ies) are… | accepts HTML tags |
Changelog (v. 75)
last updated 01 May 2012 11:55
Browser Compatibility
CSI was built and tested on the latest version of Google Chrome.
Version 75 was tested to be working in the following browsers/versions:
- Google Chrome 18.0.1025.162 m
- Mozilla Firefox 10.0.2
- Internet Explorer 9.0.6
This does not mean that this CSI will not function correctly in other browsers. If you encounter any problems with running Advanced Search CSI in any browser, please report below.
Advanced Usage
Include files
Advanced Search Include | By tsangk | 28 Nov 2011 12:25 |
Advanced Search Include Backend | By tsangk | 29 Nov 2011 06:42 |
This is super awesome!!!
See also the wish / rant on the blog: http://blog.wikidot.com/blog:improved-search/comments/show#post-1318224
Service is my success. My webtips:www.blender.org (Open source), Wikidot-Handbook.
Sie können fragen und mitwirken in der deutschsprachigen » User-Gemeinschaft für WikidotNutzer oder
im deutschen » Wikidot Handbuch ?
Great job!
Sorry to all the watchers of the CSI site about the ~20 emails they got from me editing this CSI. I have implemented a couple of new parameters to allow for what this wish/rant asks for. You are able to pre-define the categories and always enforce it in all search results.
[[include :csi:include:adv-search
|defaultCategory=categorya,category2,category3
|enforceDefault=true
|showCategory=none]]
Kenneth Tsang (@jxeeno)
Awesome! That's exactly what I needed. Thanks Ken!
I didn't even notice this until now. This will be perfect for one of my sites - thanks! :)
Edit: Actually — is there any way for me to hide the original search listing? It would be perfect if I could only display it after someone's entered a search term.
Edit 2: Ignore my comments above… I'm getting confused about things that I'm sure are actually pretty simple! :) This is the code I'm using:
If I previewed it before saving, two search fields would be displayed on the page. After saving only one is displayed, but the filter by category doesn't seem to be enforced (I see results from different categories as well).
Any hints to get this working? Basically, I want to allow the user to enter the search term themselves, but to restrict the results to only pages (not forum), from the 'skin' category.
~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server | NEW: Wikiroo, backup tool (in development)
@Shane: Try something like this:
[[include :csi:include:adv-search
|defaultCategory=skin
|text=Search skin category
|enforceDefault=true
|defaultMode=p
|enforceMode=true
|mini=true
|hideFilters=true]]
Kenneth Tsang (@jxeeno)
I found something. The search page is still reloading from about 9 minutes, but the only page who is in the nav category and has the word admin in it is the nav:Top. The search engine already found that page, but why it is still reloading?
@Artimonier: Can you send me the link of your search query?
Kenneth Tsang (@jxeeno)
Sure. It is the same as in the description: http://advanced-search.wikidot.com/search:site/a/pf/q/admin%20%20category:nav
Okay, this has been fixed. Thanks for reporting!
Kenneth Tsang (@jxeeno)
Everything works fine now. Thanks :D
Out of interest, what browser are you viewing/testing this CSI in?
Kenneth Tsang (@jxeeno)
I'm using Chrome.
Many thanks from me too as the author of the original wish/rant that prompted this.
I've just finished hacking a copy of your previous version to add sufficient category filtering to achieve what I wanted but this looks much better. Excuse me while I go and delete all my recent changes and use this instead :-)
And the moral of this story is… Don't jump in and try to solve problems yourself, just rant loudly in a public place and wait quietly while some helpful and more talented coder does it for you. LOL!!!
Wanders off feeling ever so slightly stupid…………
Hmm well…… your post of 1 December wasn't actually the first wish for searching by categories as the wish 18 months ago shows :)). It's no competition though and your post probably flagged it up for Kenneth to look at it. It's good that we have clever people like Kenneth (who's only about 14!) who can do this stuff.
Rob Elliott - Strathpeffer, Scotland - Wikidot first line support & community admin team.
Hi Kenneth,
well done and a great success in reacting so quickly !
Now i think you should write a blog with this new layout , filters and hiding possibilities on the community blog!
Service is my success. My webtips:www.blender.org (Open source), Wikidot-Handbook.
Sie können fragen und mitwirken in der deutschsprachigen » User-Gemeinschaft für WikidotNutzer oder
im deutschen » Wikidot Handbuch ?
This is really something we needed!
Tsangk, is it possible to customize it a little bit more? I would need to remove the possibility to search the forum, and I would like to have it translated to Serbian?
If slaughterhouses had glass walls, everyone would be vegan. - Paul McCartney
It's possible - but, I'm busy for the next two weeks… :(
I'll see if I have time :)
Kenneth Tsang (@jxeeno)
@Brunhilda: I implemented the second of your wishes… to be able to translate the strings. Each of the labels and notes are now changeable through these variables:
Kenneth Tsang (@jxeeno)
Thanks, Tsangk for being sou quick, but I must admit I don't have a clue what I should do… :(
Could you explain me what exactly I should do?
Thanks!
If slaughterhouses had glass walls, everyone would be vegan. - Paul McCartney