Improving the 505 Table of Contents display
We have a variety of basic and enhanced formatted table of contents in the 505. With help from Ex Libris Support and Jesse Kruppa, we are now using the following rules for Contents.
rule "Primo VE - contents 505gtr"
#creates list style TOC
#if the record has 505 with subfield g, t, or r
#copy the g, t, r subfields in that order to a temp field and wrap in prefix & suffix placeholders
#replace the delimiter in subfield g with prefix & suffix with html bold
#replace the delimiter in subfield t with prefix & suffix with html italic
#replace the delimiter in subfield r with html line break
#repeat for each new heading in subfield g
#replace any occurrence of double hyphen with blank
#create the contents display in the PNX from the temp field
when
MARC."505" has any "g,t,r"
then
set TEMP"1" to MARC."505" sub without sort "g,t,r" wrap subfields
replace wrapping delimiters (TEMP"1","g","<b>","</b><br>")
replace wrapping delimiters (TEMP"1","t","<span>•</span> <i>","</i>")
replace wrapping delimiters (TEMP"1","r","","<br><br>")
replace string by string (TEMP"1","--","")
create pnx."display"."contents" with TEMP"1"
end
rule "Primo VE - contents 505a"
#creates list style TOC
#if the record has 505 with subfield a
#copy the subfield a to temp field
#replace any occurrence of double hyphen with <span>•</span> html
#primoVE doesn't support <li> tags
#add <span>•</span> html to start of temp field
#space is added after the </span> tags for readability
#create the contents display in the PNX from the temp field
when
MARC is "505"."a"
then
set TEMP"1" to MARC."505" sub without sort "a"
replace string by string (TEMP"1","(--|;)","<br><span>•</span> ")
add prefix (TEMP"1","<span>•</span> ")
create pnx."display"."contents" with TEMP"1"
end