You want to integrate a Dokuwiki installation into a Drupal front-end.

Considerations:

A primary function of a Wiki is to allow page creation when a page doesn't exist. Since Drupal has specific handling for non-existent pages, it is important to override Drupal's default handling. This is done via URL rewriting. In Apache you would use mod_rewrite functionality.

Another consideration is mapping user accounts between the two. Since Drupal's user management scheme is more developed, this recipe defers all user creation and logging-in functionality to Drupal. This is done primarily through the Dokuwiki auth functionality, but requires URL rewriting for seamless handling.

Step one─altering Drupal's default file handling

  1. Choose the URL for your Wiki. You can set this up in one of several ways:
    1. Install Dokuwiki in your Drupal installation directory in an appropriately-named sub-directory;
    2. Use mod_alias to point a given URL to the appropriate sub-directory; or
    3. Use sym-links in the Drupal directory to point to link to the appropriate sub-directory
  2. Prepend the following RewriteCond to Drupal's list of RewriteCond. You would find this in your .htaccess or httpd.conf file, replacing wiki with the base path of your Dokuwiki installation :
       RewriteCond %{PATH_INFO} !^/wiki/ [NC]
    This is only necessary if clean URLs are being used in Drupal. What this does is to ensure that only non-Dokuwiki URLs are rewritten for Drupal clean URLs.

Step two─deferring user creation and login to Drupal

  1. Add the drupal_ext.class.php file to your /auth directory
  2. Register the Drupal auth method with Dokuwiki
    1. From the Dokuwiki configuration page (Admin > Configuration Settings), select "drupal_ext" next to "Authentication backend.", OR
    2. Set the auth type in your local.php file:
      $conf['authtype'] = 'drupal_ext';
  3. Inform the drupal_ext auth script of the location of your Drupal configuration. Add the following line in your Dokuwiki local.php file:
    $conf['auth']['drupal']['file'] = '/path/to/drupal/sites/drupal-installation/settings.php';
    where you replace /path/to/drupal with the actual absolute path to your Drupal installation, and drupal-installation with the site-specific installation directory. If you only have a single installation, this would probably be default.

Step three─redirecting Dokuwiki login/logout actions to the Drupal login/logout pages

Caveat I doubt this is necessary─is there a way to internally alter the destination for the login and logout buttons in Dokuwiki, without hacking the theme?

  1. Add the following lines to either the Dokuwiki .httaccess file or the httpd.conf file:
      RewriteCond %{QUERY_STRING} \bdo=login\b [NC]
      RewriteRule ^.* /user/login [L]
    
      RewriteCond %{QUERY_STRING} \bdo=logout\b [NC]
      RewriteRule ^.* /logout [L]
    This will redirect all login and logout clicks to the login and logout pages supplied by Drupal.

TO DO

To truly integrate Dokuwiki into Drupal, a Drupal module should be written to simply process Dokuwiki calls within the Drupal application. Also, a Dokuwiki theme needs to be created to strip all headers and footers from the Dokuwiki page creation results, with menus added to Drupal to duplicate the functionality.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

hi

Topic is very informative. Thanks.
--
car insurance ny

Post new comment

  • 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

Back to top