Altering htt and bsh Files in BPP

Note: altering htt and bsh files is an advanced topic. The flexibility inherent in BPP results in considerable complexity. Whereas a knowledge of html is sufficient for altering simpler skins, a knowledge of programming is probably needed to make more than the simplest change to BPP.

Index.htt and slide.htt are “html template files”. All of the index and slide image pages in a generated album are based upon these two templates. JAlbum processes index.htt for each index page in the generated album, and processes slide.htt for each slide image page in the generated album.

Index.htt and slide.htt contain a combination of straight html, JAlbum-specific tags, and Beanshell code.

JAlbum-specific tags appear in two ways in BluPlusPlus:

  • as a way to include code from another source, e.g.,
    <ja:include page="<%= new File(skinDirectory,"bsh/slide.bsh").getAbsolutePath() %>">Code NOT Included</ja:include>
  • as a way of controlling (via an “if..then..else” structure) what html is actually generated for the output page, e.g.,
    <ja:if test="<%= slideBackgroundPath!=null %>">
      <table width="100%" border="0" cellspacing="0" cellpadding="0" background="<%= slideBackgroundPath %>">
        <tr>
          <td colspan="3" height="5"><img src="$resPath/empty.gif" alt=""/></td>
        </tr>
    </ja:if>
    <ja:else>
      <table class="pagebody" width="100%" border="0" cellspacing="0" cellpadding="0">
    </ja:else>

There are other JAlbum-specific tags that are not used in BluPlusPlus. The JAlbum web site has more details about this.

Beanshell code fragments are contained inside angle braces “<...>”, and come in two flavors:

  • “normal” beanshell fragments, in the form “<%...code fragment...%>”, which contain any Beanshell language code
  • “output” beanshell fragments, in the form “<%=...code fragment...%>” (note the ‘=’ sign!), which outputs the results of the code steps to the html page being generated

More details about scripting JAlbum can be found on the JAlbum web site.

The beanshell code in slide.htt and index.htt call functions and use variables defined in beanshell (.bsh) files (see files provided by BPP for a list of bsh files used by BPP).