How to: create a wiki with Drupal

Please leave a comment below! I'd love to hear your opinion!

Over the past two years, Drupal's wiki capabilities have expanded exponentially. Yet, still we get support requests on the forums, "How can I make a wiki with Drupal?" Well, here is a detailed plan that gives wiki functionality to Drupal. This tutorial assumes you're starting with an installed version of Drupal 5.x, and that you're familiar with installing modules.

Absolute Wiki Essentials:

  1. Step 1: Allow for categorization of wiki pages.

    There is often this request: I want to be able to categorize my wiki pages into a hierarchy. Well, with Drupal core's book module, you can do just that! First, enable the book module. Then, go to the admin/content/types page to view your content types. Delete any content types you don't want. Then, rename the "Book page" content type to "Wiki page" or something similar. Also, in the "workflow" fieldset, make sure to check the "create new revision" checkbox. This will make it so that, by default, every edit of a page is done in a revision.

  2. Step 2: Install the wikitools module.

    The wikitools module is an essential for all Drupal wikis. From deletion protection, to move protection, to ensuring that there is only one page for each title, wikitools is the future of Drupal wikis. Install it, and then configure the settings on the admin page to fit into your idea of how your wiki should work.

  3. Step 3: Create a wiki-style filter.

    There are several ways of doing this. I recommend the pearwiki filter module, as it allows for much flexibility. However, also consider the freelinking module, which is easier to install. If you use the freelinking module, you will have to check the "Hijack freelinking module" checkbox on the wikitools install page. Then, configure your input format with the appropriate filters.

  4. Step 4: Configure permissions.

    At the admin/user/access page, configure user permissions. Here are some recommended settings:

    Of course, feel free to alter these settings as appropriate to your site.

Cool Drupal wiki tricks

What's next?

Now that you've read this article, do you have any more ideas? Perhaps you have another cool wiki Drupal tip to share? Or maybe you want to implement some wiki-style Drupal features, but aren't sure how. Or else you're trying out some of the things I suggested, but having trouble? Feel free to post a comment below; I'd love to hear what you have to say.

Comments

not clear

This sentence in the first step didn't make sense:
Delete any content types you don't want, and rename it to "Wiki page" or something similar.

What does the "it" refer to? The book content type?

Ah, good catch.

Nice catch :). Updating the post now. Thanks.

Thank you...

...for your simple breakdown. Great timing, as we'll be trying this real soon. I'll report back.

Any thoughts on how well this might integrate with an Organic Groups (OG) scenario, other modules (like Case Tracker)?

Best,

--D

Wikitools

The wikitools module, at the core of Drupal's wiki capabilities, is designed to be lightweight. It would integrate (or so I guess) quite well with the organic groups module or the case tracker module, as it simply extends Drupal's capabilities, so it is not just another add-on module that can cause problems, but mostly just a highly compatible extension of the Drupal core.

OG and group Books

Thanks for some great tips! Maybe you can tell something about OG and Book combination.
OGs provide quite a nice way to hide and group content. But it also makes everything a lot more complicated to show specific content to certain users. What's your take on this, how should the groups be set up so that everything would work like a charm? Should I create separate "Group book page" content type to create books inside groups or use the "book page" provided by Drupal? At the moment I have difficulty to show the book navigation inside a group, maybe Drupal isn't sure which book navigation I want to show.

wikitools vs liquid

Could you explain why you choose wikitools over the liquid module? There are quite a few ways to set up a wiki in Drupal and I wonder for what reasons you prefer the wikitools.

I recommend the wikitools module

I recommend the wikitools module because it is much more lightweight than the liquid module. It has some features that it adds to Drupal, but it is not a "solution"- it simply adds functionality to that which Drupal already had. If you have any reasons why you prefer the liquid module, feel free to share them.

Moving content from an existing wiki?

What a great article! The list of modules available for the task certainly is impressive, and they cover probably all of the work needed to make a wiki-like site. Couple of questions:

  • Can uploads (images or files) be "versioned" as well?
  • Do you have any suggestions for moving a lot of content from (say) a Mediawiki site to a Drupal one?

Suggestions for both:

First of all:

For uploads (images or files) to be "versioned" as well, look into the Web File Manager module. It supports version options to avoid file overwrite.

Second of all:

For moving content from, say, a Mediawiki site to a Drupal one look into the node import module, which can read in data from a csv or tsv file and turn that data into nodes. I know that Mediawiki has an "export" function which exports in an xml format; I'm currently working on a way to import that format into Drupal, ignoring any irrelevant data. However, if you can figure out how to export data into a csv file, the node import module will work fine.

However, if you want to simply integrate a Drupal install with a Mediawiki install, look at the Mediawiki module, which allows for some extent of integration between the two.

fantastic!

This is great... I will try and report back to you.

Help

I have installed this wikimedia and configured all modules as per http://stephenondrupal.blogspot.com/2007/10/set-up-wiki-with-drupal-5.html can any one show me how does a wiki page look like from within Drupal.. I am not getting the behavior...

Look at

You can look at my demo site at http://wiki.cwgordon.com/. It has no content, but demonstrates how a Drupal 6 wiki looks.

site wide revisions

Is there a way to view 'Recent Changes' on a sitewide basis, i.e. list of all recent revisions across the whole wiki?

Yes, there is!

Use the Recent Changes module!

Tried this today, works

Tried this today, works brilliantly.

Any ideas how to do templates/transclusion, or should this just work without me having to do anything?

_____
ASIDE:
For those interested, the following will give you a dump of the latest revisions from the your mediawiki database (replace databasename and table names with your own values:
SELECT
replace(page.page_title,'_',' ')
, text.old_text
FROM
databasename.page
INNER JOIN databasename.revision
ON (page.page_latest = revision.rev_id)
INNER JOIN databasename.text
ON (revision.rev_text_id = text.old_id);

Would this work without Books?

This look to be just what I'm after - and simpler than I thought it would be.

However, I wonder if it would work without using books?

I'm using books on the site I'm building for the main navigation structure. As the wiki is only a sub-set of the site, I'd like to restrict another content-type for the wiki, perhaps stories or something via CCK. Would all of the above still work?

Yes, but

Yes, it would still work; however, you would lose the ability to organize the wiki into a hierarchy, which is a popular feature request. Also, if you are using Drupal 6, you do not have to wory about restricting book pages, as the Drupal 6 book module allows any of several content types to work under the book module.

Nice work!

Nice work! Thanks for writing this up and sharing as well as moving Drupal wiki functionality forward, it's a great resource for the community.

thanks

Great guide, appreciate your work very much!

Brilliant Article

Thanks for the in depth article, this is exactly what I've been looking for.

Hi - I've read some of your

Hi - I've read some of your comments over on groups.drupal.org. You seem very passionate about wiki functionality in Drupal, and this tutorial will be a great help on a project I'm working on.

If there's anything I can do to help you along with wiki development, please let me know. I've been looking for a way to contribute to the Drupal community, and this just might be it!

Formatting the wiki to make more readable

This worked great for me as well. Thanks!! The one issue I am confronted with is how unreadable the text is since there is no real formatting embedded to separate the text when you add multiple headings of more than one level on one page of the wiki. Any thoughts on how to improve this would be appreciated.

Is there a way to default the parent section of a wiki page?

This is a great article... Was there a reason why you used "Books" as the default, as opposed using a page or story? I followed your steps and modified books. I was concerned with was keeping all the pages within one book. Because I am not the only one using the wiki I wanted to make it as fool proof as possible. It seemed to make sense to default the parent section to one book when creating a page.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

Do not enter anything in this field.