Outputs an HTML link (
<a> tag). The link can point to a URL that you
specify, a URL stored in a Vae text field, or the
Permalink of an entry. If this tag is used from within a
<v:collection> block, it will automatically append
the ID and title of the current entry to the link. By appending this ID
to the URL, you will be able to directly access attributes of that entry
on the new page.
This tag is often used to link to detail pages specific to an entry in a
collection. For example, there might be a page that lists all artists
and then uses the
<v:a> tag to link to pages specific to each artist.
<v:a> tag can be used in several different ways.
Use 1 – link to the permalink of the current entry
If neither the
path attributes are provided, Vae will
render a link to the permalink for the current entry. If the current
entry does not have a permalink, nothing will be rendered.
Use 2 – specify a link destination URL
href. This will become the href attribute of the generated
If this tag is used from within a
<v:collection> block, Vae will
automatically append the ID and title of the current item to the link.
If you want to use a different ID (for example a parent item or child
item), provide the relative path to that item in the
To disable this behavior entirely, pass in the root path (
Use 3 – link to a URL specified in a Vae text item
path- the path to the Vae text item containing a URL. (Uses VaeQL syntax)
If this text item is blank, nothing will be rendered. (
render an empty link.)
Use 4 – use this link as a Previous or Next link for pagination
id- give this link a unique ID and set the
next=attribute of a
<v:collection>tag to the ID of this tag. The
<v:collection>must come before this tag in the page source.
If these aren’t set properly, nothing will be rendered. (
render an empty link.) Additionally, Vae won’t render the Previous link
if the viewer is on page 1, and we won’t render the Next link if the
viewer is on the last page unless the
wrap= option is set in the
ajax- ID of the
ajaxbefore- if using the
falsefrom this code snippet to cancel processing.
ajaxsuccess- if using the
animate- if using the
ajaxoption, this option may be set to
fadeInto animate in the new content.
autofollow- if set to the value of
<v:a>tag is within a
<v:collection>that only has one item, a browser redirect will be sent to automatically send the visitor to the link target. This is useful when you wish to display a menu of choices when there are more than one, but direct the visitor directly to the only available choice if there is only one.
jump- jump to this anchor in the page when the link is clicked. Only works if the
ajaxattribute is specified. This is useful for ensuring that the container holding your AJAX’d content is visible when the link is clicked.
loading- if using the
ajaxattribute, this option may be set to the path of an image that will be used as a loading ‘spinner’ indicator.
loadingposition- if using the
loadingattribute, this option may be set to
afterto control the placement of the loading indicator.
oncomplete- if using the
Since this tag generates an HTML
<v:a> tag, you may also use any
standard HTML attributes that are valid in the
<v:a> tag. These will
be passed through unchanged into the generated tag.
This snippet of code:
Would render something like:
If the locations collection has permalinks defined, you
could omit the
href= attribute entirely and Vae will render the
Would render something like this (the exact permalinks would depend on how you configured Permalinks in the backstage):
Loading pages in via AJAX: