The <cms:link> tag

This tag acts as a wrapper to build a valid OpenCms URL for a given internal VFS resource. This allows you to set URLs without having to add the name of the web application and servlet context manually. Second, if a page is exported into a static HTML page by OpenCms, a URL wrapped in a <cms:link> tag will be replaced by it's static link target.

Note: <cms:link>  cannot be used for external links to other domains!

Attributes:

This tag has no attributes.

Body:

The body of this tag contains the resource name.

Example usage:

Build a valid URL for a resource in the current folder:

<cms:link>index.html</cms:link>

Build a valid URL for a resource in another folder:

 <cms:link>/some/other/folder/index.html</cms:link>

Build a valid URL for a resource in the root folder:

 <cms:link>/index.html</cms:link>