hst-core-tags
Tag link


This tag creates links. It knows whether to include or exclude the contextpath and servletpath. The attributes 'link' and 'node' get the current servletpath in their result, the 'path' attribute does *not* get the servletpath. The reasoning is that the 'path' attribute is used for static links, like for css and images. You should use one of the three attributes (link|path|node) within one tag, and not more then one. If you do not specify the 'var' attribute, the output is directly written. Otherwise, the value is stored in the var attribute. If you only specify a hst:link (with or without var), you get a hst link for the current URL

Example:
<!-- In a body component: A list of document names with summaries and links to those documents: --> <c:forEach var="child_document" items="${document_list}"> <tr> <hst:link var="link" hippobean="${child_document}"/> <td class="title"> <a href="${link}">${child_document.name}</a> </td> <td>${child_document.summary}</td> </tr> </c:forEach> <!-- In a <head>: --> <hst:link var='screencss' path='/css/community/screen.css'></hst:link> <link media='screen' href='${screencss}' type='text/css' rel='stylesheet'></link> <!-- In a menu: --> <ul id="nav-main"> <c:forEach var="item" items="${menu.menuItems}"> <c:choose > <c:when test="${! empty item.externalLink}"> <li> <a href="${item.externalLink}"><b>${item.name}</b></a> </li> </c:when> <c:when test="${item.expanded}"> <li class="active"> ${item.name} </li> </c:when> <c:otherwise> <li> <hst:link var="link" link="${item.hstLink}" /> <a href="${link}"> ${item.name} </a> </li> </c:otherwise> </c:choose> </c:forEach> </ul> <!-- Create a hst link for the current URL: --> <hst:link /> OR <hst:link var="current"/> to store it in the var 'current'


Tag Information
Tag Classorg.hippoecm.hst.tag.HstLinkTag
TagExtraInfo Classorg.hippoecm.hst.tag.HstLinkTag$TEI
Body ContentJSP
Display NameNone

Attributes
NameRequiredRequest-timeTypeDescription
varfalsefalsejava.lang.StringThe variable name of the link tag
linkfalsetrueorg.hippoecm.hst.core.linking.HstLinkA HstLink object, containing a already rewritten object
pathfalsetruejava.lang.StringA string path, typically a location relative to the webapp
subPathfalsetruejava.lang.StringA string subPath which gets appended to the path with a delimiter './' . This makes it useful for creating REST links
hippobeanfalsetrueorg.hippoecm.hst.content.beans.standard.IdentifiableContentBeanAn IdentifiableContentBean object. This is typically one of your bean mapped objects
nodeIdfalsetruejava.lang.StringIdentifier of an HippoBean object. This is a stringified identifier of one of your bean mapped objects
siteMapItemRefIdfalsetruejava.lang.StringA string id, which is the refId of a sitemap item you want to link to. Note that the sitemapitem belonging to the refId should not be a wildcard matcher, and non of its ancestors should be a wildcard. Using this to create a link to a sitemap item can be handy when you know to which sitemap item you want to link, but not the path. For example, a single jsp is used for 2 languages which have their own sitemap. You want a link to 'contact' for English, and to 'kontakt' for Dutch. Using this attribute, you can link to a refId on the sitemap item. Both 'contact' and 'kontakt' should have the same refId then
fullyQualifiedfalsetruejava.lang.BooleanIf value is 'true' the created link will be a fully qualified link (URLs), thus starting with 'http://' or 'https://' etc
canonicalfalsetruejava.lang.BooleanIf the link that is created should be the canonical link, use this attr with value true
navigationStatefulfalsetruejava.lang.BooleanIf the link should be created in the context of the current URL, use this attr with value true. When having canonical='true', this attribute is ignored.
mountfalsetruejava.lang.StringExpert: Create a link for a mount with alias that has the value of this attribute. You can create cross-domain links with this, even to mounts having a different host name. Or to a mount belonging to REST calls.
mountTypefalsetruejava.lang.StringExpert: Create a link for a mount with type that has the value of this attribute. You can create cross-mode links with this, even to preview mount or live mount. Also, you can combine this with 'mount' attribute to create cross-domain links with specific type.
escapeXmlfalsefalsejava.lang.BooleanWhether or not to escape &,>,<,", and '. When escapeXml = true, the link can be safely used as a tag attribute (e.g, href, src, etc.) value. By default escapeXml is set to true.
scopefalsefalsejava.lang.StringScope of var or the localization context configuration variable. "page", "request", "session" or "application". "page" scope by default.

Variables
No Variables Defined.


Output Generated by Tag Library Documentation Generator. Java, JSP, and JavaServer Pages are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries. Copyright 2002-4 Sun Microsystems, Inc. 4150 Network Circle Santa Clara, CA 95054, U.S.A. All Rights Reserved.