Difference between revisions of "Displaying Units"

From CollectiveAccess Documentation
Jump to: navigation, search
(Using relativity)
(Using relativity)
Line 5: Line 5:
 
Let's say you're creating a Collection summary and you'd like to display metadata about Entities, but Entities aren't related directly to Collections.  Perhaps they are related to Objects related to the Collection.  Never fear!  Just as Bruce Willis is 2 degrees away from Kevin Bacon (thanks to Brad Pitt, "The Hamster Factor" and the movie "8"), Entities are also 2 degrees away from Collections thanks to their relativity to Objects.
 
Let's say you're creating a Collection summary and you'd like to display metadata about Entities, but Entities aren't related directly to Collections.  Perhaps they are related to Objects related to the Collection.  Never fear!  Just as Bruce Willis is 2 degrees away from Kevin Bacon (thanks to Brad Pitt, "The Hamster Factor" and the movie "8"), Entities are also 2 degrees away from Collections thanks to their relativity to Objects.
  
How does this look in practice?  Here's a display template that is placed on the object bundle (through the GUI) or object placement (in a profile).  It pulls statement metadata from a container on the Entity related related to the Object.
+
How does this look in practice?  Here's a display template that is used on the object bundle (through the GUI) or object placement (in a profile).  It pulls statement metadata from a container on each Entity record related to each Object.
 
<code><pre>
 
<code><pre>
 
<em><strong>^ca_objects.preferred_labels</strong></em><br>
 
<em><strong>^ca_objects.preferred_labels</strong></em><br>
Line 14: Line 14:
 
</pre></code>
 
</pre></code>
  
The result is a list of artwork titles, artist names and their statements for the works in the collection:
+
The result is a list of artwork titles, artist names and their statements for the works in the collection.  Note that in the ''Falling Water'' example entity John Smith has two repeats of the statements container:
  
 
[[File:RelativityDisplay.png|800px]]
 
[[File:RelativityDisplay.png|800px]]
  
In addition to pulling the metadata (that has a "Bacon number" of 2) into the display the unit tag is also the reason the containers are correctly formatted.  Without <unit> tags repeating containers would look like this:
+
In addition to pulling the metadata (that has a "Bacon number" of 2) into the display, the unit tag is also the reason each container is correctly formatted.  Without <unit> tags repeating containers would look like this:
  
 
Address Line 1 A; Address Line 1 B<br>
 
Address Line 1 A; Address Line 1 B<br>

Revision as of 20:47, 7 November 2013

Using relativity

One use of the <unit> tag is to allow cataloguers to display metadata with some relative distance to the chosen record. We could call this the Six Degrees of Kevin Bacon for CollectiveAccess.

Let's say you're creating a Collection summary and you'd like to display metadata about Entities, but Entities aren't related directly to Collections. Perhaps they are related to Objects related to the Collection. Never fear! Just as Bruce Willis is 2 degrees away from Kevin Bacon (thanks to Brad Pitt, "The Hamster Factor" and the movie "8"), Entities are also 2 degrees away from Collections thanks to their relativity to Objects.

How does this look in practice? Here's a display template that is used on the object bundle (through the GUI) or object placement (in a profile). It pulls statement metadata from a container on each Entity record related to each Object.

<em><strong>^ca_objects.preferred_labels</strong></em><br>
^ca_entities.preferred_labels
<br><unit relativeTo="ca_entities" delimiter="<br><br/>">
^ca_entities.statement.statement_text<br/>^ca_entities.statement.statement_date<br/>^ca_entities.statement.statement_source
</unit>

The result is a list of artwork titles, artist names and their statements for the works in the collection. Note that in the Falling Water example entity John Smith has two repeats of the statements container:

RelativityDisplay.png

In addition to pulling the metadata (that has a "Bacon number" of 2) into the display, the unit tag is also the reason each container is correctly formatted. Without <unit> tags repeating containers would look like this:

Address Line 1 A; Address Line 1 B
Address Line 2 A; Address Line 2 B
Address Line 3 A; Address Line 3 B

rather than this:

Address Line 1 A
Address Line 2 A
Address Line 3 A

Address Line 1 B
Address Line 2 B
Address Line 3 B

Namespaces

Variants
Actions
Navigation
Tools
User
Personal tools