Objective: Out-of-the box formatting of the 505 (contents) field is one long block of text. This norm rule formats the 505 field in a list, with each entry on its own line.
Before:
After:
MARC."505" has any "g,t,r"
(MARC."505"."t" match ".*" OR MARC."505"."g" match ".*") AND NOT MARC."505"."r" match ".*"
then
set TEMP"1" to MARC."505" sub without sort "g,t" wrap subfields
replace wrapping delimiters (TEMP"1","g","","<br>")
replace wrapping delimiters (TEMP"1","t","","<br>")
replace string by string (TEMP"1","Research articles:","Research articles:<br>")
replace string by string (TEMP"1","--","")
create pnx."display"."contents" with TEMP"1"
end
rule "Primo VE contents 505r"
when
MARC."505" has any "g,t,r"
(MARC."505"."t" match ".*" OR MARC."505"."g" match ".*") AND MARC."505"."r" match ".*"
then
set TEMP"1" to MARC."505" sub without sort "g,t,r" wrap subfields
replace wrapping delimiters (TEMP"1","g","","")
replace wrapping delimiters (TEMP"1","t","","")
replace wrapping delimiters (TEMP"1","r","","<br>")
replace string by string (TEMP"1","Research articles:","Research articles:<br>")
replace string by string (TEMP"1","--","")
create pnx."display"."contents" with TEMP"1"
end
rule "Primo VE - contents 505a"
when
MARC is "505"."a"
then
set TEMP"1" to MARC."505" sub without sort "a"
replace string by string (TEMP"1","(--|;)","<br>")
create pnx."display"."contents" with TEMP"1"
end
rule "Prima_Display - contents 880-505"
when
MARC is "880" AND
MARC."880"."6" match "505-.*"
then
create pnx."display"."contents" with MARC "880" excluding num subfields without sort
end
Code credit: Santa Fe College, based on code shared on the Primo VE listserv October 19, 2021 ("Primo VE : Table of Contents" thread)