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
- Choose the URL for your Wiki. You can set this up in one of several ways:
- Install Dokuwiki in your Drupal installation directory in an appropriately-named sub-directory;
- Use mod_alias to point a given URL to the appropriate sub-directory; or
- Use sym-links in the Drupal directory to point to link to the appropriate sub-directory
- 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 :
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.RewriteCond %{PATH_INFO} !^/wiki/ [NC]
Step two─deferring user creation and login to Drupal
- Add the drupal_ext.class.php file to your /auth directory
- Register the Drupal auth method with Dokuwiki
- From the Dokuwiki configuration page (Admin > Configuration Settings), select "drupal_ext" next to "Authentication backend.", OR
- Set the auth type in your local.php file:
$conf['authtype'] = 'drupal_ext';
- Inform the drupal_ext auth script of the location of your Drupal configuration. Add the following line in your Dokuwiki local.php file:
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.$conf['auth']['drupal']['file'] = '/path/to/drupal/sites/drupal-installation/settings.php';
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?
- Add the following lines to either the Dokuwiki .httaccess file or the httpd.conf file:
This will redirect all login and logout clicks to the login and logout pages supplied by Drupal.RewriteCond %{QUERY_STRING} \bdo=login\b [NC] RewriteRule ^.* /user/login [L] RewriteCond %{QUERY_STRING} \bdo=logout\b [NC] RewriteRule ^.* /logout [L]
Coalface.net
Comments
hi
Topic is very informative. Thanks.
--
car insurance ny
Post new comment