Component Templates

The /pages/components/ directory contains templates that are reused among several pages or are used as module on a single page. These components are meant to be "stand-alone", though they may not work properly unless certain other script files or macros are declared in the <head> of the containing template. These components can be included on any page by adding <#include "path/to/component.ftl" />.
comments/

The comments/ sub-directory contains the templates that provide comment functionality on a page. documentCommentThread.ftl will enable commenting on an entire document or page. elementLevelComments.ftl enables commenting on a specific element on a page.

Any page that includes either of these templates must also include the /pages/header/titaniaAnnotator.ftl template.

feedback/

The feedback/ sub-directory contains feedback.ftl. Including this template on a page adds a "Thumbs Up/Thumbs Down" widget to that page. This template is included in viewer.ftl, mapViewer.ftl , and several Custom Templates by default.

This template works seamlessly with the viewer pages listed above. To use this template to collect feedback on other Portal content such as graphics or static html in the page, the page must meet this templates' assumptions. Those assumptions include:

  1. There must be a data-pageId attribute on the <html> element. This value should be universally unique. Default Portal Theme pages accomplish this by setting the value to ${UUID}.
  2. The feedback will be associated with an element that has the id attribute with a value of viewerContent. When including this template on a new page, make sure to specify exactly one element with that ID that will be the target of the feedback.
  3. The feedback target must have an attribute called data-portalKey with the value ${portal.key?html}
  4. The feedback target must have an attribute called data-itemKey. For content in a viewer page, this is set to be that content's key from within its Project. For use on any other Portal content, this value should be set to something unique and descriptive of the element.
footer.ftl
This template contains any information that should be included in the "footer" of the page, such as graphics and copyright information. The footer also contains a QR code that will link to the current page.
genericHeader.ftl
This template is the generic version of header.ftl and is intended for use only on error pages, such as 404.ftl and 500.ftl, or any other page where a full header that includes log-in information, a search bar, and other widgets may not be apporpriate.
header.ftl
This is the header bar for most Portal pages. It inludes the name of the portal and several links. If it is a secured portal it will contain a "log-in" link, a user dropdown (when logged in) and a search bar on all pages except portal-home.ftl.
macros.ftl
This template contains Freemarker macros that simplify the use of some portal tags. See Macros for more information.
qr.ftl
This template places a QR code into the page that will link back to the containing page. It is #includeed into footer.ftl.
searchForm.ftl
This template only appears in searchResults.ftl. It adds a search box to the page which includes all of the search facets available and relevant to the current search results.
watermarks.ftl

This template adds a "Draft" watermark to the background of any page containing content with the metadata draft=true. Additional watermarks can easily be added. For example, add the following to watermarks.ftl:

<#if metadata?? && metadata['test']?? && metadata['test']?seq_contains('true')>
  <div id="watermark">DRAFT</div>
</#if>

Then, add the metadata rule test=true to any content exposed to that Portal. You should now see the "test" watermark in the background.