Create Internal Page in Koha. Creating pages in Koha 19.11.

Here is how to create a internal page in Koha 19.11 and how to link to a menu in Koha OPAC page.

# cd /usr/share/koha/opac/cgi-bin/opaccp opac-main.pl pages.pl 
# vim pages.pl

At around line line no#39 look for following line :

template_name  => "opac-main.tmpl",

You may either comment (with #) or replace the 'opac-mail.tmpl' with 'pages.tt' that you have created as
template_name  => "pages.tt", 


Now add the following code at around line no#112

my $page = "page_" . $input->param('p');           
           my $preference = C4::Context->preference($page);  
           $template->{VARS}->{'page_test'} = $preference;  

Save and exit the page.

Next, Change the permission of the pages.pl

#chmod 755 pages.pl

Next:
#cd /usr/share/koha/opac/htdocs/opac-tmpl/bootstrap/en/modules
#cp opac-main.tt pages.tt
#vim pages.tt

At around line no# 109 look for the following code
[% IF ( OpacMainUserBlock ) %]<div id="opacmainuserblock">[% OpacMainUserBlock | $raw %]</div>[% END %]

and replace it with the following line

[% IF ( page_test ) %]<div id="opacmainuserblock">[% page_test %]</div>[% END %]


Save and exit the page.

Now, open the file :
#vim /etc/koha/apache-shared.conf

Add the following line at line no#12

ScriptAlias /pages.pl "/usr/share/koha/opac/cgi-bin/opac/pages.pl"

Save and exit the file.

Now here is how to create a file. Go to Koha > Administration >  System preferences > Local use

Click on New Preference to create a page.

And add the details. The page name should always begin with "page_"

For example if you want to create a About Us page then name should be something like "page_aboutus" Check the image below.


To check if you can access the new page try to browse the page that you created:
http://your_IP_address/pages.pl?p=aboutus

This way you can create additional pages by clicking on New Preference.

Now to link the new pages to you OPAC hyperlink, go to System Preferences > OPAC > opacnav and add the HTML tags  as shown in the image below.





Comments

Popular posts from this blog

ACTION_FAILED:OU_INVALID: Solution for GoogleApps bulk user upload issue, username@domainname.com:ACTION_FAILED:OU_INVALID. This error is because you have not specified the Org Unit Path properly.

Email Notification in Koha! How to configure Email Notification in Koha 20.11 with postfix?

Solution to Moodle Error: Coding error detected, it must be fixed by a programmer: Failed to unserialise data from file. Either failed to read, or failed to write.