The anchor model works in conjunction with the $anchor function. The first parameter to this function coincides with an anchor definition created using the anchor model. Generally speaking, all external links or internal links to documents (such as PDFs) should be implemented using the anchor model. This way, you can quickly obtain a list of external links used throughout your site. $anchor should not be used to link to pages of the current site since $link is the better option for this.

One of the advantages of using $anchor is that a given anchor can me used throughout your site. Therefore, if you often reference a particular external site, and the address of this site changes, you only need to update this URL in one definition.

Specifying the Anchor href

Every anchor needs an href value. If you are linking to an external site, enter the href in the URL field. If you are linking to a document within your site, enter the name of the document in the Document field. This document must reside in your site's public docs folder. The document name can include a path if the document resides within a subfolder of docs.

Entering Additional Properties

Additional properties allow you to supplement the generated anchor tag with whatever properties (attributes) are required. By default, links are generated with target="_blank" so that they open in a new tab, if you do not want this you should specify an alternate target value in the properties.

In addition to the normal properties supported by HTML anchors, you can also include certain special properties (these all start with *). Here are the special properties supported.

*button

You can set this property to one of the following colors in order to generate the link as a button: black, blue, green, grey, red, white.

By default, buttons are assigned the classes "medium button auto filed" as well as a class matching the color. If you don't want this you must assign your own class property. The following supplied classes can be used:

Size Classes: tiny, small, medium, large, xlarge

Style Classes: filed, round, tab

Width Class: full, auto

When overriding the class, you must also include the button class. For example, setting *button to green and setting the class to "xlarge green button full round" would result in a wide button (spanning its container) such as the following:


Here is an example of a red button styled with class "tiny red button auto"


*description

This description can be used by other models that refer to the anchor object.

*image

If you want to show an image rather than anchor text, specify the id of the image to be used. This image must be defined using the image model. The default size for the current platform will be rendered in the anchor.

*link-text

This property can be used to override the anchor text when calling the $anchor function to render the image.

*obfuscate

When set to true, this property will generate an obfuscated link that is controlled using javascript. This is done to hide the link from search engines for the purpose of pagerank sculpting.

*mysite-document

This property is used internally to store the link to a document such as a PDF in the docs folder.

*translation

A translation class can be used to support multi-lingual link text. If the link text is to be translated, use the internationalisation escape character in place of the link text (this defaults to :). By default the anchor id will be used as the translation variable. If you want to use an alternate translation class or variable you can also explicitly reference these in the link text as in :class->variable. A third option is to reference the translation class in the link text as in :someclass. With this option the translation variable will be the anchor id.

Sample anchor definition
🡇
Sample anchor definition