Customizing Template Behavior
There’s much more to Slash templates than changing text output options. A common modification is adding banner ads to a site. Again, Slash’s roots with Slashdot make this easy. Even site administrators responsible for internal sites can find some helpful ideas for further template editing.
Banner Ads
Many popular ad management packages have sprung up. There are several
popular Apache modules for this purpose, including mod_random and Adfu. One,
mod_adbanners
, was written by Kurt Gray specifically for
OSDN (neé Andover.net) sites, and works very well with Slash. It is
available for download at http://modadbanners.sourceforge.net/. Installation of an Apache module is
relatively simple. Follow the compilation directions in
Section 2.4.3 in Chapter 2 and in the INSTALL
file.[41]
After the module is installed and httpd.conf
has been
modified per the installation instructions, restart the web server to test the
configuration. When everything works, you then must edit the configuration
file for the site which will run banner ads. For
firewheel, this file is
/usr/local/slash/site/firewheel/firewheel.conf
. Copy the
contents of the docs/httpd.conf.example
file provided with
the module into the configuration file, changing the file paths as appropriate
for your system.
Next, copy the data and ad files to their proper destinations. The
.dat
files from
/usr/local/adsystem/dat/
will go to the directory named in
the AddBanner
directive. The ads in
/usr/local/adsystem/htdocs/banner/ ...
Get Running Weblogs with Slash now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.