To enable syntax highlighting in Drupal posts, you can use the GeSHi Filter module. This module uses Generic Syntax Highlighter - GeSHi, which is a third-party PHP library that supports more than 100 programming languages.
To install this module, you'll have to:
- install the GeSHi Filter Drupal module from http://drupal.org/project/geshifilter
- download the GeSHi library from http://qbnz.com/highlighter/ and unzip the archive in the module directory sites/all/modules/geshifilter
Once everything has been copied over, you should enable the module. Go to Administer >> Site Building >> Modules.
Now you'll have to add the GeSHi filter to your input filters. Go to Administer >> Site Configuration >> Input Filters.
The final step is to enable the languages you think you're going to use by going to Administer >> Site configuration >> GeSHi Filter >> Languages.
- radu's blog
- Login to post comments
I wanted to install Drupal in a subdirectory, for instance ~/public_html/drupal, and still access it as root.
The theory is simple: put Drupal in a subdirectory then add a .htaccess file in the root directory that redirects non existing URL's to '/drupal'. But in practice it proves to be trickier than I thought.
So, here is the code for the .htaccess file:
Options -Indexes
Options +FollowSymLinks
<IfModule mod_rewrite.c>
RewriteEngine On
# skip processing the drupal files
RewriteCond %{DOCUMENT_ROOT}/drupal%{REQUEST_URI} -f
RewriteRule .* drupal/$0 [L]
# process drupal urls
RewriteCond %{HTTP_HOST} ^kenjiru\.ro|www\.kenjiru\.ro$ [NC]
RewriteRule ^$ drupal/ [L]
# the actual redirect
RewriteCond %{HTTP_HOST} ^kenjiru\.ro|www\.kenjiru\.ro$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ drupal/$1 [L]
</IfModule>I specified the domain because I'm having other addon domains hosted on the same document root.
- radu's blog
- Login to post comments
