These are instructions for taking a default install of Koha 3.0 and allowing it to function as a little content management system. This will allow a library to publish an arbitrary number of pages based on a template. This example uses the template for the main opac page, but you could just as well use any template you wish with a bit more editing. This may be appropriate if you have a small library, want to allow librarians to easily add pages, and do not want to support a complete CMS.
my $cgi = new CGI;
template_name => "opac-main.tmpl",
To this code:
template_name => "pages.tmpl",
$template->param( koha_news => $all_koha_news, koha_news_count => $koha_news_count );
To this:
my $page = "page_" . $cgi->param("p"); $template->param( koha_news => $all_koha_news, koha_news_count => $koha_news_count, local_page => "" . C4::Context->preference($page) );
<!-- TMPL_IF NAME="OpacMainUserBlock" --><div id="opacmainuserblock" class="container"><!-- TMPL_VAR NAME="OpacMainUserBlock" --></div><!-- /TMPL_IF -->
To this code:
<!-- TMPL_IF NAME="local_page" --><div id="opacmainuserblock" class="container"><!-- TMPL_VAR NAME="local_page" --></div><!-- /TMPL_IF -->
If you have problems check file permissions on pages.pl and pages.tmpl. They should have the same user and group as other Koha files like opac-main.pl.
Instead of using the address http://youraddress/cgi-bin/koha/pages.pl?p=test you can shorten it to http://youraddress/pages.pl?p=test Just open up /etc/koha/koha-httpd.conf and add the follow at about line 13:
ScriptAlias /pages.pl "/usr/share/koha/opac/cgi-bin/opac/pages.pl"
Then restart Apache.