Welcome, guest ( Login )

» Home (JDC Blog)
» Forums

Page Tags

navigation search how-do-i plugin sidebar toolbar

Search Tags:
WikiHome » 2006-3-14-FindingYourWayInJotspot

Finding Your Way in JotSpot

Version 1, changed by ScottMcmullan. 03/14/2006.   Show version history

By ScottMcmullan at 03/14/2006 10:46AM Tags: navigation, search, how-do-i, plugin, sidebar, toolbar

Navigating and maintaining a sense of place when using a wiki can be difficult. When pages can be created almost anywhere, even the most meticulously gardened wikis can become confusing and hard to navigate, particularly for new users.

There are a number of ways to address this problem, but here are four common approaches:

  1. Displaying recently changed pages
  2. Displaying recently visited pages
  3. Displaying pages that are "under" the current page
  4. Displaying pages that link to the current page

While none of these views are visible by default in Jot, they're all easy to add to your wiki by packaging up a few lines of code as a plugin. Here's how. (Note: See JotPluginIntro or FirstPluginTutorial if plugins are new to you.)

1. Recent Changes Plugin

This plugin is pretty straightforward. It grabs the most recent 5 pages from all pages sorted by editTime. It then loops this list and prints the link to the page. (The "slice()" line truncates the page titles at 20 charracters so they don't flow into the main page.)

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:jot="http://www.foopee.com/ns/s3/srvtmpl/">
   <jot:extension target="sidebarBottom">
      <div id="recent-changes-plugin" class="sidebarBox">
         Recent Changes<br /><br />
         <jot:search order="editTime-" set="recent" forAll="1" limit="5" />
         <jot:loop over="recent">
            <jot:script>
              //<![CDATA[
              var recentTitle = it.name.slice(0,20);
              //]]>
            </jot:script>
            <a href="${it/href}">${recentTitle}</a><br />
         </jot:loop>
         <a href="wiki:/System/Pages/RecentChanges">more…</a><br />
      </div>
   </jot:extension>
</html>

2. Recently Visited Plugin

I blogged details for this plugin here back in January -- please see 2006-1-5-RecentlyViewedPluginAndTheSessionObject.

3. Pages Below Plugin

This is another straighforward case of a search and then a loop over the results. Here's the code:

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:jot="http://www.foopee.com/ns/s3/srvtmpl/">
   <jot:extension target="sidebarBottom">
      <div id="pages-below-plugin" class="sidebarBox">
         <jot:search forDescendants="${page/name}" set="descendants" />
         <jot:loop over="descendants">
            [[${it/name}]]
         </jot:loop>
      </div>
   </jot:extension>
</html>

4. Incoming Links Plugin

I blogged details for this plugin here back in October -- please see 2005-8-29-BacklinksPlugin.

Sidebar Management

While this code is easy for a developer-minded person to copy/paste into a new plugin, most folks aren't comfortable doing this.

We're currently designing an interface to make the installation and management of this type of sidebar functionality easier for non-technical users. If you've got suggestions or good examples of how this ought to be done, we'd love to hear from you.


Back to WikiHome



Attachments (2)

  File By Size Attached Ver.
 recentChangesPluginScreenshot.png ScottMcmullan 3K 03/14/2006 1 Delete attachment
 recentlyVisitedPluginScreenshot.png ScottMcmullan 2K 03/14/2006 1 Delete attachment