Enhancing the Genie OPAC Page Header

by Jonathan Jacobsen Sunday, November 09, 2008 10:24 PM


The options for including a header across the top of the Genie OPAC pages that are supported by Genie out-of-the-box  are limited to referencing an image in the myGenie.config file, using the following line:

<add key="MyLogo" value="images/your_logo.gif" />

The image referenced in this line appears at the top of all OPAC pages. The image can be a small logo, or can extend the full width of the OPAC pages (approx. 800 pixels) to provide an eye-catching header. For some sites, this is all that is required.

However, if you want to have the Genie OPAC header match an existing public or internal website, a simple image may not be sufficient. Typically a header includes text, images and site navigation, so HTML may be required, not just an image.

You can insert a custom header that includes HTML in the Genie header by editing the OPAC .aspx files directly. These include:

  • opac.aspx
  • opac_report.aspx
  • opac_cart.aspx
  • opac_items_search.aspx
  • opac_items_report.aspx
  • opac_loans_checkout.aspx
  • opac_loans_report.aspx
  • login.aspx
  • logout.aspx

While you may include the complete header HTML in these .aspx pages directly, it is more efficient to place it in a separate file, then use an ASP.net user control to pull it in. For example, if a file called header.ascx is created and contains the HTML for the site header, then add the following statement at the top of opac.aspx:

<%@ Register Src="~/include/header.ascx" TagName="Header" TagPrefix="uc" %>

and the following statement immediately after the <body> tag in opac.aspx:

<uc:Header ID="Header1" runat="server"></uc:Header>

This will result in the contents of header.ascx being included in the page when served to the user.

By separating the header HTML from the page, rather than embedding it in each of the OPAC pages, it is easy to subsequently edit the header to match changes to the rest of the site, without having to edit each OPAC page.

The same technique may be used to include a footer, or any other secondary content, within the OPAC pages.

One caveat of this technique is that if future versions of Genie include changes to any of the OPAC .aspx pages, the upgrade process will likely overwrite the modified versions. It is therefore important to keep a backup copy of those pages, and following the upgrade, to edit the new OPAC .aspx pages to re-insert the above code.

Note also that in the above example, in the path "~/include/header.ascx", the ~ means "resolve to application root", which is typically the folder in which Genie is installed, and /include/ is a new folder created to store all the files and images related to the header, to keep it separate from the Genie files themselves.

blog comments powered by Disqus

Month List