How to: create a wiki with Drupal

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.

This is a good article,

This is a good article, thanks Gordon.

Is there a way to show IP addresses and links to ban spamming IPs and usernames? It is possible to ban IPs and users in Drupal, but it's a very long-winded process when dealing with the volume of spam most serious wikis attract.

Up to the moment, I still

Up to the moment, I still have problem to integrating table of content module with pear wiki filter.
When the two used together, table of content is not shown. Rearrange filter priority couldn't fix this problem.

On the other hand, it looks like some peoples have similar problem with me, which you may take a look at here http://drupal.org/node/260512

If there is someone could get this works please tell me.

hierarchy?

Thanks so much for this; I've been wanting to make a wiki in my Drupal site for a long time and hadn't been able to until now. I have one major doubt though, and it's regarding the hierarchy in wikis. I understand that the book content type is used (and not a story or a page) mainly because of hierarchy, and I can't come to a conclusion on wether I'm going to need hierarchy or not. I mean, do wiki sites usually use hierarchy relationships between their entries? Does Wikipedia, for example? Any light shed on this will be appreciated.

WYSIWYG

Any wysiwyg integration posible?

I would like my users to edit the wikipages in wysiwyg.

WYSIWYG and Wiki

It appears you might want to use the Freelinking module instead of the PEAR Wiki Filter module if you want to use a WYSIWYG editor like TinyMCE for editing your wiki pages.

Check out the discussion (from groups.drupal.org/wiki): Do we need Mediawiki syntax when we have WYSIWYG editors?.

good!

great it works!
but i have 2 questions:

1)it is possible to go to 404 wiki page and allow to create new content if search form don't find anything??
2)how did you create wiki browser??

thanks in advance
Anto

thank you

this post finally explained a few things clearly- i'd read a few other posts on wiki for drupal and this one explained far more of them

More than one wiki

Great tutorial! Is it possible to have two seperate wiki's operating within the same drupal installation? They would need to not overlap and be able to handle different types of information.

More than one wiki?

I would love to hear a response to this. I currently use books for another purpose and don't want to cross books with wiki content. Has anyone found a solution for this. For example, is there a way to create a new content collection type, similar to books, but completely and distinctly separate?

Converting Existing Drupal Site to a Wiki

Your information was very informative and I'll be looking over the demo sites above.

Can you offer any strategic advice on converting an existing drupal 5.12 website to a wiki or a site with wiki features. I know the technology is available but wonder if people will just be confused by the the constellation of content--- stories, wikis, forums, blogs

My current site has about 160 articles (stories), a few blogs and a forum. I have no books.

Orphaned pages

very helpful, and I used as a reference in how I built a wiki in Druap 6:
http://cratel.wichita.edu/cratel/cratel_Drupal_6_wiki

My big question is how to find orphaned pages in the wiki. Any ideas?

FCKeditor support and other mediawiki syntax?

Hi,

I followed your article thru, and I see that I can now use some of the wiki syntax. But other syntax still isn't supported. I'm new to all this, so I don't quite know whether there are good reasons for the other syntax not being supported.

I'm trying to choose between mediawiki and drupal, and I'd really prefer to use drupal. But the lack of full support for mediawiki's syntax makes it difficult to know which way to go ....

Do you have advice for such a user?

Also, I wondered if there was wysiwyg support for any of these wiki formats.

filter by node type

just realized, that nobody mentioned this:
if you want your wiki to be just part of a site that offers other types of editing: install the filterbynode module and restrict the wikifilter only to the wikipages (so users cant apply the syntax in others)

Editing Pages in the Wiki??

Thank you so much for posting this information. It is really helpful.

I followed the directions and thought I set everything up correctly. However when I set up a test user so I could see how it worked for someone without admin privileges, the wiki user can't edit the page.

The edit tab is there and you can actually make changes etc. But when you try to save the changes the page title disappears and there is an error message saying the page must have a title. If you try to add the title info back in you are unable to edit the title area and have to just back out of the page without saving any changes.

Any ideas on how to fix this? My site won't be much use to my users if they can't edit their wiki.

Locking your wiki

I would like to have an internal wiki, that is password protected, where in drupal do I have to set up that the whole content is only available to it's users? Do I have to do that individually to the area of the wiki only?

You can make content private

You can make content private in a number of ways. I was not sure how granular you needed (individual pages, open only to you, open to a departement, open to just authenticated users).

Most of the ways involve the use of "user permissions". These configuration settings enable you to define who can see pages (visitors, groups, authenticated users, etc) and/ or edit the pages.

Another option is to create a sub-site where you are the only login. I work at a college and I am setting up a college-wide site, a department site and a personal site all on the same server using only a single copy of Drupal.

Can I see demo drupal wiki

Can I see demo drupal wiki anywhere ? Thanks

Importing MediaWiki data (tutorial here)

Hi cwgordon7!
First, your "how to" really helped me to set up our Wiki and I'd like to thank you for that. Then, I guess many people arriving on this page may also wonder how to import old MediaWiki data if (like me) they want to transfert their old site to a Drupal one. I did search on the web to do so but without success, so I wrote down a simple "MediaWiki importer" that could help other people like me.

I'm not saying it works perfectly but it did for my stuff and it can be used by others to create their own importer. You can find it there
http://southgreen.cirad.fr/sites/all/files/mediawiki2drupal.zip

This zip contains the the guide lines on how to proceed to import a MediaWiki content into Drupal and it includes the required source PHP code. I hope it'll help some people.

More than one wiki

Any advice on how to set up a site with more than one wiki?

How to create multiple wikis

If you follow the method that cwgordon7 has prescribed, then all you have to do is to create as many "books" as the number of wikis needed. Do not give my users the "create new books" permission. This way you can control how new wikis are created.

marking broken links

this great and thank!

...but the one thing I'm missing is a way of marking links that don't have pages yet.

MediaWiki uses color, other wikis put a "?" after the link, but most wikis let the reader know when there's a place to contribute.

Is anyone running a Drupal-based wiki site with a solution, or can someone see how to use a contrib module to get the right effect?

Or have I done something wrong and wikitools should be doing it anyway :)

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

You must answer the above question correctly to be able to submit a comment. This measure is designed to protect this site against spambots, which seem able to circumvent even the toughest image captchas. Hint: try googling for the question answer if you really don't know it. The theory behind this is that if this website is running its own completely custom captcha, it will not be in anyone's economic advantage to rewrite their spam bot's code to handle this website's questions. Powered by CwgordonCaptcha.