Exhibit/Lens Templates

Exhibit Reference Home &raquo; To add a custom lens template your exhibit, add

…

Settings include:

The URL of an Exhibit page followed by a hash with the label of an item will display a dialog box with that item's properties. You can create a lens template for this dialog box to specify which properties are displayed and how. The lens needs to be inside the body of the HTML page but outside any view elements, with its display style set to none. For example, this lens controls what will be displayed in a dialog for a single item of type Person:

 …

can be used to execute Javascript or change style attributes when the lens is displayed. The mailing list includes these details.

For example,

…

causes the lens to always be blue. (Of course you could have just used style="background: blue".) Use this.getAttribute('ex:itemID') to get the ID of the item. An elaborate example would include a lens template like this

 …   …    …   …

together with some Javascript like this

function prepareLens(elmt) { var itemID = elmt.getAttribute("ex:itemID"); var tab1 = document.getElementById("tab1-" + itemID); var tab2 = document.getElementById("tab2-" + itemID); … }