soo_multidoc_link
Usage
Generates an HTML anchor element, based on document relationship. Can be used as a single or container tag. Requires individual article context.
<txp:soo_multidoc_link rel="Prev" /> <txp:soo_multidoc_link rel="Next">Continue reading ... </txp:soo_multidoc_link>
When used as a single tag, the text
attribute value is used for the link text (see below).
Attributes
rel="LinkType"
The link type describing the linked document’s relationship to the current pageadd_title="boolean"
Add the linked document’s title to the link texttext="link text
Link text when in single-tag mode. The tokens{rel}
and{title}
will be replaced by their respective values for the link. The default is{rel}
.class="HTML class"
HTML class attribute value for the anchor tagactive_class="HTML class"
HTML class attribute value ifrel
refers to the current page (tag will be aspan
instead ofa
)html_id="HTML ID"
HTML ID attribute value for the anchor tagwraptag="tag name"
Tag name (no brackets) for element to wrap the anchor
Example usage
The navigation links at the bottom of every page of this article are generated by soo_multidoc_link
tags. They are in a form called “soo_multidoc”, which is called by my default article form. The “soo_multidoc” form looks something like this:
<ul id="soo_multidoc_prev_next"> <txp:soo_multidoc_link rel="Start" add_title="1" wraptag="li" /> <txp:soo_multidoc_link rel="Contents" wraptag="li" /> <txp:soo_multidoc_link rel="Up" wraptag="li" /> <txp:soo_multidoc_link rel="Prev" wraptag="li" /> <txp:soo_multidoc_link rel="Next" wraptag="li" /> <txp:soo_multidoc_link rel="Download" wraptag="li" /> <txp:soo_multidoc_link rel="Help" wraptag="li">Support</txp:soo_multidoc_link> <txp:soo_multidoc_link rel="Copyright" wraptag="li">License</txp:soo_multidoc_link> </ul>
Using wraptag="li"
prevents empty list items from being created where the document relationship does not apply, e.g. there is no “Prev” link on the Start page.
Container or single tag
When used as a single tag, soo_multidoc_link uses the rel
value as the link text (see example above), unless the add_title
attribute is set. In that case you get the article title as the link text:
<txp:soo_multidoc_link rel="next" add_title="1" />
results in: soo_multidoc_pager
When used as a container tag, soo_multidoc_link uses the contents of the tag as the link text. In this case, if you set add_title
the article title will be added after the tag contents:
<txp:soo_multidoc_link rel="contents" add_title="1">Multidoc: </txp:soo_multidoc_link>
results in: Multidoc: Table of contents
You can use next or prev in combination with another link type:
<txp:soo_multidoc_link rel="prev section" add_title="1">previous section: </txp:soo_multidoc_link>
results in: previous section: Getting started