<core:link>

Writes a link to a page and optionally an element. If element not provided, then page is required. If page is not provided, links to element within the current page.

Any attribute that has no namespace and begins with param. is added to the href as a URL parameter. The parameter name is the part of the attribute name following param..

When a parameter value is null it is not added. If the value is an Iterable, Iterator, Enumeration, or array, then each non-null element is coerced to String as a separate parameter in iteration order. Otherwise, the value itself is coerced to String for the parameter value.

Nested <core:param> or <core:params> tags will add parameters after any provided as attributes.

If there is no body, writes the target page title or element label.

Tag Information

Tag Class: com.semanticcms.core.taglib.LinkTag
TagExtraInfo Class: None
Body Content: scriptless
Display Name: None
Dynamic Attributes: true

Attributes

Name Required Evaluation Type Description
class No Deferred-Value Object

The CSS class for the link. Defaults to a target-specific value, if any defined for the target element. To avoid the default, pass an empty class: <core:link class="" … />

book No Deferred-Value String

The book containing the page. Defaults to the book of the current JSP file.

page No Deferred-Value String

The page-relative path to the page. If not provided, must be nested in a <core:page> tag and assumes the current page. Required when book provided.

element No Deferred-Value String

The page-unique id of the element to link to.

This is used to reference SemanticCMS elements within a page. Conflicts with the anchor attribute.

To reference a specific non-SemanticCMS-element target, use the anchor attribute instead.

The anchor is automatically prefixed in multi-page views. The anchor is also URL-encoded.

allowGeneratedElement No Runtime boolean

When false, the default, may not link to generated ids. This is to avoid broken links as it is preferred to set explicit ids on target elements. Set to true to allow linking to generated element ids.

anchor No Deferred-Value String

The anchor to link to on the given page.

This is used to reference non-SemanticCMS-element targets within a page. Conflicts with the element attribute.

To reference a specific SemanticCMS element, use the element attribute instead.

The anchor is automatically prefixed in multi-page views. The anchor is also URL-encoded.

view No Deferred-Value String

The view mode to use in the link target.

Although view is site defined, some common values might include:

  • null, "", or content (the default and always supported) - Links to the page content
  • what-links-here
  • tree
  • all
  • files
small No Runtime boolean

When false, the default, will generate a <a> tag around the entire body. Otherwise, will generate a <span> instead, with a small link added to the end of the body.

Use of a small link can be helpful for usability, such as when the body is a piece of information intended for quick copy/paste by the user.

absolute No Runtime boolean

When true, generates an absolute URL for the href for the link. Defaults to false.

canonical No Runtime boolean

When true, will generate a Canonical URL. Canonical URLs should be used where per-user response URL rewriting (such as information added when cookies are disabled) should be avoided. Defaults to false.

Variables

No Variables Defined.