You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tags/link_to_next.md
+19-6Lines changed: 19 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,37 +52,50 @@ Tag will accept the following attributes (**case-sensitive**) as well as the {%
52
52
### Example 1: Link to next article using the article title
53
53
54
54
~~~html
55
-
<txp:link_to_next>
55
+
<txp:link_to_nextwraptag="div"class="nav_next">
56
56
<txp:title />
57
57
</txp:link_to_next>
58
58
~~~
59
59
60
-
### Example 2: Link to next article using static text
60
+
Important: The `<txp:link_to_next>` tag automatically has its container context set to *the next article*. Thus to retrieve the article title of this article, use the `<txp:title />` tag and *not* the `<txp:next_title />` tag. Using the latter tag in the `<txp:link_to_next>` container would 'skip' an article title. Compare this usage to Example 3 where the single tag is used and the `<txp:next_title />` is therefore appropriate to fetch information from the next document.
61
+
{: .alert-block .information}
62
+
63
+
Other tags used: [next_title](/tags/next_title), [title](/tags/title).
64
+
65
+
### Example 2: Link to next article
61
66
62
67
~~~html
63
68
<txp:link_to_nextshowalways="1">
64
69
Next
65
70
</txp:link_to_next>
66
71
~~~
67
72
73
+
or to display the text in the current site language:
74
+
75
+
~~~html
76
+
<txp:link_to_nextshowalways="1">
77
+
<txp:textitem="next" />
78
+
</txp:link_to_next>
79
+
~~~
80
+
68
81
This will always display the text 'Next', even when there is no next article.
69
82
70
-
Note: While `showalways` will enable this tag to display what is wrapped inside it, [next_title](/tags/next_title) returns nothing if there is no next title, so nothing is displayed. Use text, or the returned value, that you need displayed.
83
+
Note: While `showalways` will enable this tag to display what is wrapped inside it, [next_title](/tags/next_title) returns nothing if there is no next title, so nothing is displayed. Use fixed text instead in this case.
71
84
{: .alert-block .information}
72
85
73
86
### Example 3: Customising links
74
87
75
-
The container tag returns only a very basic link, which doesn't allow for customising the link title, or adding a CSS class, etc. Using the tag in its single tag capacity opens up a lot more possibilities.
88
+
The container tag returns only a very basic link, which doesn't allow for customising the link title. Using the tag in its single tag capacity opens up more possibilities.
76
89
77
-
For example, to give the link an HTML `title` attribute of the next article's title, and also apply a `class` to it:
90
+
To give the link an HTML `title` attribute of the next article's title:
Copy file name to clipboardExpand all lines: tags/link_to_prev.md
+18-5Lines changed: 18 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,11 +52,16 @@ Tag will accept the following attributes (**case-sensitive**) as well as the {%
52
52
### Example 1: Link to previous article using its title
53
53
54
54
~~~html
55
-
<txp:link_to_prev>
55
+
<txp:link_to_prevwraptag="div"class="nav_next">
56
56
<txp:title />
57
57
</txp:link_to_prev>
58
58
~~~
59
59
60
+
Important: The `<txp:link_to_prev>` tag automatically has its container context set to *the previous article*. Thus to retrieve the article title of this article, use the `<txp:title />` tag and *not* the `<txp:prev_title />` tag. Using the latter tag in the `<txp:link_to_prev>` container would 'skip' an article title. Compare this usage to Example 3 where the single tag is used and the `<txp:prev_title />` is therefore appropriate to fetch information from the previous document.
61
+
{: .alert-block .information}
62
+
63
+
Other tags used: [prev_title](/tags/prev_title), [title](/tags/title).
64
+
60
65
### Example 2: Link to previous article using static text
61
66
62
67
~~~html
@@ -65,24 +70,32 @@ Tag will accept the following attributes (**case-sensitive**) as well as the {%
65
70
</txp:link_to_prev>
66
71
~~~
67
72
73
+
or to display the text in the current site language:
74
+
75
+
~~~html
76
+
<txp:link_to_prevshowalways="1">
77
+
<txp:textitem="prev" />
78
+
</txp:link_to_prev>
79
+
~~~
80
+
68
81
This will always display the text 'Previous', even when there is no previous article.
69
82
70
-
Note: While `showalways` will enable this tag to display what is wrapped inside it, [prev_title](/tags/prev_title) returns nothing if there is no previous title, so nothing is displayed. Use text, or the returned value, that you need displayed.
83
+
Note: While `showalways` will enable this tag to display what is wrapped inside it, [prev_title](/tags/prev_title) returns nothing if there is no previous title, so nothing is displayed. Use fixed text instead in this case.
71
84
{: .alert-block .information}
72
85
73
86
### Example 3: Customising links
74
87
75
-
The container tag returns only a very basic link, which doesn't allow for customising the link title, or adding a CSS class, etc. Using the tag in its single tag capacity opens up a lot more possibilities.
88
+
The container tag returns only a very basic link, which doesn't allow for customising the link title. Using the tag in its single tag capacity opens up more possibilities.
76
89
77
-
For example, to give the link an HTML `title` attribute of the previous article's title, and also apply a `class` to it:
90
+
To give the link an HTML `title` attribute of the previous article's title:
0 commit comments