[OPEN-ILS-GENERAL] Adding MARC fields to TPAC display (template variables)

Tony Bandy tonyb at ohionet.org
Thu Aug 1 15:19:51 EDT 2013


Hi all,

Just fishing for some help this afternoon.  Perhaps this should have gone
to the developers list.  If so, I apologize in advance.

--------

We're looking to enhance the MARC display in our TPAC (2.3.6) with the
addition of some MARC fields.  While I did find this,
http://docs.evergreen-ils.org/2.3/_designing_your_catalog.html#_configuring_and_customizing_the_public_interface,
in the documentation, I'm having some mental issues figuring out what this
documentation actually means on a practical basis.  For example, the
documentations says that if I want to add a MARC 260 field I should do this:

-------------------------------------------

"...to map the template variable *args.pubdates* to the date of publication
MARC field 260, subfield c, add these lines to *misc_util.tt2*:..."

args.pubdates = [];

FOR sub IN xml.findnodes('//*[@tag="260"]/*[@code="c"]');
    args.pubdates.push(sub.textContent);
END;
args.pubdate = (args.pubdates.size) ? args.pubdates.0 : ''

You will then need to edit the *
/openils/var/templates/opac/parts/record/summary.tt2* file in order to get
the template variable for the MARC field to display.

For example, to display the date of publication code you created in the *
misc_util.tt2* file, add these lines:

[% IF attrs.pubdate; %]
    <span itemprop="datePublished">[% attrs.pubdate | html; %]</span>
[% END; %]


-------------------------------------------

That's understandable to me somewhat, but what if I wanted to add other
MARC fields besides the 260?  What if I wanted to add a 5XX field or
something else?  What template variable should I use?  What exactly is a
template variable?  Is there a list of template variables somewhere that I
haven't found?  Is this a table name somewhere in the DB that I'm
overlooking?  What position (or where does it go) in this file?  I
apologize if this is an easy question, but being a regular librarian and
not a developer, these terms are still somewhat cryptic to me.

If anyone has examples or sites that could demonstrate with a "template
variables for dummies" approach, I would be forever in your debt!


Thanks,

Tony

-- 
Tony Bandy
tonyb at ohionet.org
OHIONET
1500 West Lane Ave.
Columbus, OH  43221-3975
614-486-2966 x19
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://libmail.georgialibraries.org/pipermail/open-ils-general/attachments/20130801/92fa1061/attachment.htm>


More information about the Open-ils-general mailing list