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/lang.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ layout: document
3
3
category: Tags
4
4
published: true
5
5
title: Lang
6
-
description: Textpattern will replace this tag with the 2-letter code of the language which is set as the site's language preference.
6
+
description: Textpattern will replace this tag with the 2-letter code of the language which is set as the website's language.
7
7
tags:
8
8
- Language tags
9
9
- Markup tags
@@ -22,7 +22,7 @@ tags:
22
22
<txp:lang />
23
23
~~~
24
24
25
-
The **lang** tag is a *single* tag. Textpattern will replace this tag with the 2-letter code of the language which is set as the site's language preference in the Languages panel, according to [RFC 1766](https://www.ietf.org/rfc/rfc1766.txt).
25
+
The **lang** tag is a *single* tag. Textpattern will replace this tag with the 2-letter code of the language which is set as the website's language in the Languages panel, according to [RFC 1766](https://www.ietf.org/rfc/rfc1766.txt).
26
26
27
27
## Attributes
28
28
@@ -43,6 +43,6 @@ This tag has no attributes of its own. It accepts only the {% include atts-globa
43
43
</head>
44
44
~~~
45
45
46
-
Why you might do this? When declaring a DTD, namespace and language that a site is served, the `lang` attribute is useful for ensuring translators, search engines and content parsers handle the document in the correct manner.
46
+
When declaring a DTD, namespace and language that a site is served, the `lang` attribute is useful for ensuring translators, search engines and content parsers handle the document in the correct manner.
47
47
48
48
Other tags used: [page_title](/tags/page_title), [text](/tags/text).
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_prev">
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:
Copy file name to clipboardExpand all lines: tags/newer.md
+9-10Lines changed: 9 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,13 +21,11 @@ tags:
21
21
<txp:newer />
22
22
~~~
23
23
24
-
The **newer** tag is both a *single* tag and a *container* tag. The tag should be used in a page after an article tag.
24
+
The **newer** tag is both a *single* tag and a *container* tag. Textpattern will replace this tag with a link to the next list of articles in the sort order. As a single tag it outputs the URL for the next list page. If used as a container, it will wrap the text or tag assigned to the link.
25
25
26
-
Textpattern will replace this tag with a link to the next list of articles in the sort order. The container tags wrap the text or tag assigned to the link. As a single tag it outputs the URL for the next list page.
26
+
An article list consists of the assigned number of articles set by the [article tag](/tags/article). If there are no articles available having 'Newer' status (articles ranked higher, or later, in the present sort criteria than the article shown at the top of the present list) `<txp:newer />` will not display unless the `showalways` attribute is set. It is normally used in tandem with [older](/tags/older) or [pages](/tags/pages).
27
27
28
-
An article list consists of the assigned number of articles set by the article tag. If there are no articles available having 'Newer' status (articles ranked higher, or newer, in the present sort criteria than the present top of page article) `<txp:newer />` will not display unless the `showalways` attribute is set to `1`. It is normally seen used in tandem with [older](/tags/older).
29
-
30
-
Given a `<txp:article limit="5" />` tag on the page in question, `<txp:newer />` will page down five articles at a time from the most oldest post forward in time to the most recently posted article.
28
+
Given a `<txp:article limit="5" />` tag on the page in question, `<txp:newer />` will page up five articles at a time from the oldest post forward in time to the most recently posted article.
31
29
32
30
Note: This tag is context-sensitive, meaning it will only fetch content from the section or category being viewed.
33
31
{: .alert-block .information}
@@ -36,11 +34,6 @@ Note: This tag is context-sensitive, meaning it will only fetch content from the
36
34
37
35
Tag will accept the following attributes (**case-sensitive**) as well as the {% include atts-global-link.html %}:
Copy file name to clipboardExpand all lines: tags/older.md
+8-9Lines changed: 8 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,11 +21,9 @@ tags:
21
21
<txp:older />
22
22
~~~
23
23
24
-
The **older** tag is both a *single* tag and a *container* tag. The tag should be used in a page after an article tag.
24
+
The **older** tag is both a *single* tag and a *container* tag. Textpattern will replace this tag with a link to the previous list of articles in the sort order. As a single tag it outputs the URL for the previous list page. If used as a container, it will wrap the text or tag assigned to the link
25
25
26
-
Textpattern will replace this tag with a link to the previous list of articles in the sort order. The container tags wrap the text or tag assigned to the link. As a single tag it outputs the URL for the previous list page.
27
-
28
-
An article list consists of the assigned number of articles set by the article tag. If there are no articles available having 'Older' status (articles ranked lower, or later, in the present sort criteria than the present bottom of page article) `<txp:older />` will not display unless the `showalways` attribute is set to `1`. It is normally seen used in tandem with [newer](/tags/newer).
26
+
An article list consists of the assigned number of articles set by the [article tag](/tags/article). If there are no articles available having 'Older' status (articles ranked lower, or earlier, in the present sort criteria than the article shown at the bottom of the present list) `<txp:older />` will not display unless the `showalways` attribute is set. It is normally used in tandem with [newer](/tags/newer) or [pages](/tags/pages).
29
27
30
28
Given a `<txp:article limit="5" />` tag on the page in question, `<txp:older />` will page down five articles at a time from the most recent post back in time to the oldest.
31
29
@@ -36,11 +34,6 @@ Note: This tag is context-sensitive, meaning it will only fetch content from the
36
34
37
35
Tag will accept the following attributes (**case-sensitive**) as well as the {% include atts-global-link.html %}:
Copy file name to clipboardExpand all lines: tags/popup.md
+13-23Lines changed: 13 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ layout: document
3
3
category: Tags
4
4
published: true
5
5
title: Popup
6
-
description: Textpattern will replace this tag with a popup selector for browsing by section or category.
6
+
description: Textpattern will replace this tag with a selector for browsing by section or category.
7
7
tags:
8
8
- Navigation tags
9
9
---
@@ -21,53 +21,43 @@ tags:
21
21
<txp:popup />
22
22
~~~
23
23
24
-
The **popup** tag is a *single* tag. Textpattern will replace this tag with a popup selector for browsing by section or category.
24
+
The **popup** tag is a *single* tag. Textpattern will replace this tag with a select list for browsing by section or category, wrapped in an HTML `<form>`. Selecting an entry will automatically submit the form unless scripting is disabled, in which case a 'submit' button will be displayed too.
25
25
26
26
## Attributes
27
27
28
28
Tag will accept the following attributes (**case-sensitive**) as well as the {% include atts-global-link.html %}:
29
29
30
30
`section="section_name"`
31
-
: Jump to the selected category for the named section.
31
+
: Filter the selected category by the named section, instead of listing all articles that match the category. Only of use if `type="category"`.
32
32
: **Default:** unset.
33
33
34
34
`this_section="boolean"`
35
-
: Jump to the selected category for the currently active section.
35
+
: Filter the selected category by the currently active section, instead of listing all articles that match the category. Only of use if `type="category"`.
36
36
: **Values:**`0` (no) or `1` (yes).
37
37
: **Default:**`0`.
38
38
39
39
`type="type"`
40
40
: **Values:**`section`, `category`.
41
41
: **Default:**`category`.
42
42
43
-
### Common presentational attributes
44
-
45
-
These attributes, which affect presentation, are shared by many tags. Note that default values can vary among tags.
Copy file name to clipboardExpand all lines: tags/text.md
+14-9Lines changed: 14 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,22 +21,17 @@ tags:
21
21
<txp:text />
22
22
~~~
23
23
24
-
The **text** tag is a *single* tag which is primarily used to return localized language strings from the `txp_lang` database table.
24
+
The **text** tag is a *single* tag which is used to return localized language strings from the `txp_lang` database table.
25
25
26
-
Note: only language strings designated with a type of [`common`](https://github.com/textpattern/textpacks/blob/main/lang/en.ini#L265) or [`public`](https://github.com/textpattern/textpacks/blob/main/lang/en.ini#L776) are available to use. All other language string types are reserved for use within the Textpattern system itself.
26
+
Note: only language strings designated with a type of [`common`](https://github.com/textpattern/textpacks/blob/main/lang/en.ini#L265) or [`public`](https://github.com/textpattern/textpacks/blob/main/lang/en.ini#L776) are available to use. All other language string types are reserved for use within the Textpattern back-end system itself.
27
27
{: .alert-block .information}
28
28
29
29
## Attributes
30
30
31
31
Tag will accept the following attributes (**case-sensitive**) as well as the {% include atts-global-link.html %}:
: Escape [HTML entities](https://developer.mozilla.org/en-US/docs/Glossary/Entity) such as `<`, `>` and `&` within text.
35
-
: **Values:** See the [tag escaping](/tags/learning/#tag-escaping) documentation for all possible values.
36
-
: **Default:**`html`.
37
-
38
33
`item="text"`
39
-
: Piece of text to display, preferably an item from the `name` column of the `txp_lang` database table. If the given item matches a key there, the contents of the respective item in the `data` column will be returned. Otherwise, whatever you supply as the `item` value is returned verbatim.
34
+
: Piece of text to display, preferably an item from the `name` column of the txp_lang database table. If the given item matches a key in the currently selected site language, the contents of the respective item in the `data` column will be returned. Otherwise, whatever you supply as the `item` value is returned verbatim.
40
35
41
36
## Examples
42
37
@@ -48,7 +43,17 @@ Tag will accept the following attributes (**case-sensitive**) as well as the {%
48
43
</txp:older>
49
44
~~~
50
45
51
-
Outputs the text 'older' inside the `<txp:older />` tag, respecting the current Textpattern language, instead of using the tag like this: `<txp:older>older</txp:older>` which would always render the English text 'older', it replaces the contents with the value assigned to the name 'older' in the current language. So you would see a link with the word 'älter' if you were using German `de` as the Textpattern site language.
46
+
Replaces the contents of the tag with the value assigned to the name 'older' in the current site language. It takes this information from the matching key 'older' in the txp_lang database table. So if you were using German `de` as the Textpattern site language, you would see a link with the word 'älter'.
47
+
48
+
If, however, you had used the `<txp:older>` tag tag like this:
49
+
50
+
~~~html
51
+
<txp:older>
52
+
Older
53
+
</txp:older>
54
+
~~~
55
+
56
+
then it would always render English text, which is undesirable if your site is changed to show content in a different language.
0 commit comments