How to create a wiki in Drupal 6

Due to a requirement for a work related project, I needed to structure a wiki to provide a 'how to' guide for a site.  Having already built one in Drupal 6 several months ago (www.shippingwiki.com), I decided to use Drupal 7, but quickly discovered that most of the modules aren't updated for Drupal 7 and rolled everything back to 6.  This is the document process for this version.  The wiki that I've created is at wiki.containerauction.com.

Modules needed:

  • Drupal 6
  • WikiTools
  • Flexifilter  (Drupal 7 build is still in development at this was written)
  • Diff: (Optional) Allows you to see/compare any changes or updates.
  • TOC: (Optional) Creates a nice table of contents format.
  • Admin Menu:  (Optional) It makes life easier.
  • Talk: (Optional) It allows for a dialogue on the page.

Once you've got those loaded into your server, you can start to install and configure your Wiki site.

1. Install Drupal 6 as you normally would.

2. Install and activate the WikiTools, Flexifilter, Diff, TOC, Admin Menu, and Talk modules.

3. Create a new content type named 'Wiki'.  If you'd like, give it this description:

A <em>wiki page</em> is a page of content, organized into a collection of related entries collectively known as a <em>wiki</em>. A <em>wiki page</em> automatically displays links to adjacent pages, providing a simple navigation system for organizing and reviewing structured content.

Options to select when creating the content type:

  • Add the table at the top
  • Remove the table from the teaser

3. Configure the WikiTools module at [YOURSITE.COM]/admin/settings/wikitools.

  • Pay special attention to the node types, by default it's set to articles.
  • Options:  I'm using node creation, node search, automatic redirect, unique titles, and treat underscores as spaces.
  • 404 Type - Link to Creation:  If the page that you're linking to doesn't exist, provide a link to create it.


4. Create the new filter (import or manual way).  This probably won't import for some reason, but it's worth a try.  Navigate to [YOURSITE.COM]/admin/build/flexifilters and click 'Import a New FlexiFilter'.

5a. Import this code:

a:9:{s:5:"label";s:12:"Wiki";s:11:"description";s:98:"Add a link
to another page [[link|Title]], ====H4====, ===H3===, ==H2==,
'''strong''',
''italics''";s:2:"id";s:1:"5";s:7:"enabled";b:1;s:8:"advanced";b:1;s:5:"delta";s:1:"3";s:5:"cache";s:1:"0";s:10:"components";a:6:{i:0;a:3:{s:5:"class";s:24:"flexifilter_text_prepend";s:8:"settings";a:2:{s:4:"text";s:9:"";s:4:"step";s:7:"process";}s:2:"id";s:3:"102";}i:1;a:3:{s:5:"class";s:23:"flexifilter_text_append";s:8:"settings";a:2:{s:4:"text";s:8:"<nowiki>";s:4:"step";s:7:"process";}s:2:"id";s:3:"103";}i:2;a:3:{s:5:"class";s:22:"flexifilter_chunk_grab";s:8:"settings";a:7:{s:6:"starts";s:9:"</nowiki>";s:4:"ends";s:8:"<nowiki>";s:11:"pass_limits";i:0;s:14:"case_sensitive";i:0;s:12:"include_rest";i:1;s:4:"step";s:7:"process";s:10:"components";a:5:{i:0;a:3:{s:5:"class";s:28:"flexifilter_text_alternation";s:8:"settings";a:3:{s:4:"find";s:3:"'''";s:7:"replace";s:19:"<strong></strong>";s:4:"step";s:7:"process";}s:2:"id";s:3:"105";}i:1;a:3:{s:5:"class";s:28:"flexifilter_text_alternation";s:8:"settings";a:3:{s:4:"find";s:2:"''";s:7:"replace";s:11:"<em></em>";s:4:"step";s:7:"process";}s:2:"id";s:3:"106";}i:2;a:3:{s:5:"class";s:28:"flexifilter_text_alternation";s:8:"settings";a:3:{s:4:"find";s:4:"====";s:7:"replace";s:11:"<h4></h4>";s:4:"step";s:7:"process";}s:2:"id";s:3:"107";}i:3;a:3:{s:5:"class";s:28:"flexifilter_text_alternation";s:8:"settings";a:3:{s:4:"find";s:3:"===";s:7:"replace";s:11:"<h3></h3>";s:4:"step";s:7:"process";}s:2:"id";s:3:"108";}i:4;a:3:{s:5:"class";s:28:"flexifilter_text_alternation";s:8:"settings";a:3:{s:4:"find";s:2:"==";s:7:"replace";s:11:"<h2></h2>";s:4:"step";s:7:"process";}s:2:"id";s:3:"133";}}}s:2:"id";s:3:"104";}i:3;a:3:{s:5:"class";s:22:"flexifilter_chunk_grab";s:8:"settings";a:7:{s:6:"starts";s:2:"[[";s:4:"ends";s:2:"]]";s:11:"pass_limits";i:0;s:14:"case_sensitive";i:0;s:12:"include_rest";i:1;s:4:"step";s:7:"process";s:10:"components";a:3:{i:0;a:3:{s:5:"class";s:24:"flexifilter_text_prepend";s:8:"settings";a:2:{s:4:"text";s:15:"<a href="/wiki/" ;s:4:"step";s:7:"process";}s:2:"id";s:3:"135";}i:1;a:3:{s:5:"class";s:22:"flexifilter_control_if";s:8:"settings";a:2:{s:10:"components";a:2:{i:0;a:3:{s:5:"class";s:23:"flexifilter_text_append";s:8:"settings";a:2:{s:4:"text";s:0:"";s:4:"step";s:7:"process";}s:2:"id";s:3:"153";}i:1;a:3:{s:5:"class";s:24:"flexifilter_text_replace";s:8:"settings";a:3:{s:4:"find";s:1:"|";s:7:"replace";s:2:""="">";s:4:"step";s:7:"process";}s:2:"id";s:3:"167";}}s:9:"condition";a:2:{s:5:"class";s:23:"flexifilter_text_search";s:8:"settings";a:2:{s:4:"find";s:1:"|";s:8:"is_regex";i:0;}}}s:2:"id";s:3:"136";}i:2;a:3:{s:5:"class";s:23:"flexifilter_text_append";s:8:"settings";a:2:{s:4:"text";s:4:"</a>";s:4:"step";s:7:"process";}s:2:"id";s:3:"172";}}}s:2:"id";s:3:"134";}s:7:"id_next";i:176;s:9:"id_prefix";s:22:"flexifilter_component_";}s:3:"fid";s:3:"new";}</nowiki>

6.

5b. The manual way (partially lifted from here):

  1. Go to the flexifilter administration area by clicking Administer -> Site Building -> Flexifilters, and click 'Add new flexifilter'.
  2. Set the label to 'Wiki'.
  3. Set the description to 'Add a link to another page [[link|Title]], ====H4====, ===H3===, ==H2==, '''strong''', ''italics'''.
  4. Prepend with </nowiki>.
  5. Append with <nowiki>
  6. Do a chunk grab on </nowiki> and <nowiki>.
  7. Add several pattern-based text replace components:
  8. Replace ''' (three single dashes) with alternating <strong> and </strong>.
  9. Replace '' (two single dashes) with alternating <em> and </em>.
  10. Replace ==== (four equals signs) with alternating <h4> and </h4>
  11. Replace === (three equals signs) with alternating <h3> and </h3>
  12. Replace == (two equals signs) with alternating <h2> and </h2>
  13. Create a chunk grabber on [[ and ]].
  14. Add an IF component within the chunk grabber.
  15. Add the condition "text contains" with the parameter |.
  16. As subcomponents of this IF statement, prepend with <a href="/drupalwikipath/
  17. String replace | with ">.
  18. Append </a>.


6. Enable your new Flexifilte if it's not already enabled.

7. Navigate to [YOURSITE.COM//admin/config/content/formats] and allow Wiki format for your desired input format (text input is a good place to start).

8. Navigate to your wiki content type [YOURSITE.COM//admin/structure/types/manage/article] (default is 'article') and confirm that Diff is enabled .

9.  Create a new wiki page, and you'll see the options in the filters.