User Tools

Site Tools


en:user:berry_baskets

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
en:user:berry_baskets [2018/07/30 02:31] – [Setting up the Email Results Functionality] kjdonen:user:berry_baskets [2019/10/02 01:39] – [Metadata] kjdon
Line 24: Line 24:
 </code> </code>
  
-By default, these will just get added to the item's display. If you want to customise the display, take a look at the javascript code. web/interfaces/default/js/berrybasket/berrybasket.js, function showBasket() displays the small version on other pages, while web/interfaces/default/js/berrybasket/berrycheckout.js functions showFullView(), showTextView() and showEmail() display the different basket views. In particular, populateUrlsAndMetadata() displays the links plus metadata entries for Text and Email views.+Then restart Tomcat. 
 + 
 +By default, these specified metadata elements will just get added to the item's display, e.g. at the bottom of the metadata lists in the 'text' and 'email' views. Or after the title in the 'full' view 
 + 
 +If you want to customise the display, take a look at the javascript code. web/interfaces/default/js/berrybasket/berrybasket.js, function showBasket() displays the small version on other pages, while web/interfaces/default/js/berrybasket/berrycheckout.js functions showFullView(), showTextView() and showEmail() display the different basket views. In particular, populateUrlsAndMetadata() displays the links plus metadata entries for Text and Email views, and generateDocDisplay() displays the entries for the text view. 
 + 
 +=== Using dc.Title instead of Title in Berry Basket display === 
 + 
 +By default, the berry basket entries display Title metadata. If the linked item is a section, it will also display the book Title (root_Title).  
 + 
 +If we have a collection that doesn't have Title metadata (eg from a CSV spreadsheet), we can modify the code to display dc.Title instead. 
 + 
 +1. Edit web/sites/localsite/siteConfig.xml and add dc.Title into the metadataList: 
 +<code> 
 +<serviceRack name="BerryBaskets"> 
 +  <metadataList> 
 +    <metadata name="dc.Title"/> 
 +  </metadataList> 
 +</serviceRack> 
 +</code> 
 + 
 +2. Edit web/interfaces/default/js/berrybasket/berrycheckout.js 
 + 
 +Look for generateDocDisplay and edit it: 
 +<code> 
 +Replace: 
 +a.href=generateURL(doc); 
 +a.appendChild(document.createTextNode(doc['Title'])); 
 +with either: 
 +1. Use this if all documents have dc.Title instead of Title 
 + 
 +a.href=generateURL(doc); 
 +a.appendChild(document.createTextNode(doc['dc.Title'])); 
 + 
 +or: 
 +2. use this if some documents have Title and some have dc.Title 
 + 
 +a.href=generateURL(doc); 
 +if (doc['Title']) { 
 +   a.appendChild(document.createTextNode(doc['Title']));  
 +} else if (doc['dc.Title']) { 
 +   a.appendChild(document.createTextNode(doc['dc.Title'])); 
 +
 +</code> 
 + 
 ==== Document Link ==== ==== Document Link ====
  
en/user/berry_baskets.txt · Last modified: 2023/07/24 01:44 by kjdon