Component Templates
/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 containsfeedback.ftl
. Including this template on a page adds a "Thumbs Up/Thumbs Down" widget to that page. This template is included inviewer.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:
- 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}
. - 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. - The feedback target must have an attribute called
data-portalKey
with the value${portal.key?html}
- 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.
- There must be a
- 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 as404.ftl
and500.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
#include
ed intofooter.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 towatermarks.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.