Advanced Search!

Advanced Search!

By tsangktsangk on 04 Dec 2011 10:02, last edit by RobElliottRobElliott on 20 Mar 2014 17:27

Hello Fellow Wikidotians,
Recently, I released the new Advanced Search CSI (cross-site include) - an easy to use extension to the current search module. This new include extends the current search module in a number of ways:

  • users are presented with a UI to set search filters for category, author and title
  • admins can set default values for each of these values
    • in addition, admins are also able to enforce these default values (thereby restricting search results to the designated default filters)
    • plus, admins may hide these filter fields from users to remove confusion
  • admins are able to set the label of the search button

"Now, that's all good", you may say. "So, how do you do it?"

Installing the new Advanced Search module is not advanced at all! I'll provide you with a couple of snippet examples for you to copy and edit to suit your needs. For each of these, simply copy the code displayed here and replace the Search Module in your wiki's search:site and voila! Let's begin:

"Simple" Advanced Search

"Simple" Advanced Search simply replaces the current search module with one with three extra filter fields for title, author and category.

[[include :csi:include:adv-search]]


Renders this:

NOTE THIS IS A DUMMY

Change the label

This is similar to the "Simple" Advanced Search - except you are able to define the search button text. This example changes the default "Search!" text with "Find me!".

[[include :csi:include:adv-search text=Find me!]]


Renders this:

NOTE THIS IS A DUMMY

Hiding filters

This is similar to the "Simple" Advanced Search - except you are able hide certain filter fields. This example hides the title filter field.

[[include :csi:include:adv-search showTitle=none]]


Renders this:

NOTE THIS IS A DUMMY

Setting default values

This is similar to the "Simple" Advanced Search - except the filter fields can have a default value. This example shows the default title value as being "community".

[[include :csi:include:adv-search defaultTitle=community]]


Renders this:

NOTE THIS IS A DUMMY

Enforcing default values

This is the most powerful option of all. It is able to define a default filter criteria and enforce it. In this example, you may set the default search filter to be only searching pages from the _default and doc categories. You are then able to enforce this be not allowing the user to change this option. Even if changed, the final search result will end up displaying the results with the default filter applied. Finally, the category filter is hidden to prevent users from wanting to change it.

[[include :csi:include:adv-search
|defaultCategory=_default,doc
|showCategory=none
|enforceDefault=true]]


Renders this:

NOTE THIS IS A DUMMY

Wasn't that easy!? Copy and paste :)
If you have any questions on how to set up this include, leave a comment here or at the CSI site.

~ Kenneth Tsang

Facebook


Tags: csi search

Related Community Blog Posts

The following posts have similar tags and may be related to this post.

Rate it up ?

rating: +4+x

Discuss

Add a New Comment

Share

Bookmark and Share

Community Blog feed-icon-14x14.png

Posts by date

Posts by tags

addthis admin admin_forum alexa animoto app appplication attributes autocomplete automatic autonumber autosave backwards badge banner birthday blog bloo bookmark bootstrap browser bug bugs button calendar candidate category cell ceo changes chinese chrome cleanup code comment community convert count country csi css database data-forms delete deletion domain embed etension excel explorer favicon featured feature-request features file file-manager firefox fixing form forum free freemind front fun gallery gemeinschaft genealogy gerdami german glossary good google handbook header heading help helpon home homepage howto how-to html iframe images include infobox inline internet istorijska_biblioteka italian javascript job join joke link list listpages live localize mail manual mass-delete mass-edit mediawiki members membership membershipapply membershipbypassword michal microsoft mindmanager mindmap mindmeister module multi-file multilingual nested newpage news newspaper nextpage official open pagecalendar pagecalender pagepath pages %%page_unix_name%% permissions playground portuguese press previouspage private pro programming reshuffle rob row russian sandbox scheme scripting search search_engine services simplecal skins snippet social spam spanish squark styles successful syntax system table tag tags template templates theme themes thumbnail thumbnails toolbar town translate turkish tutorial tweet updated_at upload uri url user users variables video vote weneed who.is wiki wikidot wikipedia wish wishlist yaml

Posts by rating

Advanced Search!
Rating: þ{rating}þ (04 Dec 2011 10:02)

Advanced Search!
Rating: þ{rating}þ (04 Dec 2011 10:02)

Advanced Search!
Rating: þ{rating}þ (04 Dec 2011 10:02)


Blogroll

{"module":"feed\/FeedModule","params":{"src":"http:\/\/michalf.me\/feed\/pages\/category\/blog\/t\/Michal+Frackowiak%27s+blog","limit":"1","module_body":"**[http:\/\/michalf.me Michal]:** \n%%linked_title%%\n[[size smaller]]%%date|%e %b %Y at %H:%M |agohover%%[[\/size]]"}}
{"module":"feed\/FeedModule","params":{"src":"http:\/\/quake.wikidot.com\/feed\/pages\/category\/dev\/t\/Piotr+Gabryjeluk+blog","limit":"1","module_body":"**[http:\/\/piotr.gabryjeluk.pl\/ Gabrys]:**\n%%linked_title%%\n[[size smaller]]%%date|%e %b %Y at %H:%M |agohover%%[[\/size]]"}}
{"module":"feed\/FeedModule","params":{"src":"http:\/\/squark.wikidot.com\/feed\/pages\/category\/blog\/t\/Squark%27s+Latest+Posts","limit":"1","module_body":"**[http:\/\/squark.wikidot.com\/ Squark]:**\n%%linked_title%%\n[[size smaller]]%%date|%e %b %Y at %H:%M |agohover%%[[\/size]]"}}

Admin dashboard

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.