atomsite.net

The AtomPub server for .NET

Search Widget

Posted in Technical by JarrettV on 7/22/2009 10:18:03 PM - CST

The search widget provided by the blog plugin was built to be flexible enough to search at any scope within the system.  You can specify the scope when you include the widget.  There are three possible values for the scope:

Scope Description
site Searches all collections in all workspaces
workspace (default) Searches all collections in the current workspace
collection Searches only in the current collection

Below is an example of how to include the search widget in the content area of the home page.  The widget will search the entire site.

<svc:page name="BlogHome">
  <svc:area name="content">
    <svc:include name="BlogSearchWidget">
      <svc:scope>site</svc:scope>
    </svc:include>
  </svc:area>
</svc:page>

Configure in AtomSite Manager new

Now you can easily choose the scope in the AtomSite manager.  Just browse to the area where you have the search widget and choose configure.

BlogSearchWidget

And you'll get a nice choose a scope dialog.

SelectScope

When searching at the collection scope, the search box will post to an address like:
http://example.com/{collection}/search.xhtml?term=

In single workspace mode, the search at service scope and workspace scope post to the same address:
http://example.com/search.xhtml?term=

In multi-folder workspace mode, the search will post to the following addresses for service, workspace, and collection scopes:
http://example.com/search.xhtml?term=
http://example.com/{workspace}/search.xhtml?term=
http://example.com/{workspace}/{collection}/search.xhtml?term=

© Copyright 2010 Powered by AtomSite 1.4.0.0