Skip to content

Commit 35b6999

Browse files
committed
Merge branch 'master' into self-hosted
2 parents 8220737 + 41c2bae commit 35b6999

File tree

8 files changed

+85
-74
lines changed

8 files changed

+85
-74
lines changed

tags/lang.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ layout: document
33
category: Tags
44
published: true
55
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.
77
tags:
88
- Language tags
99
- Markup tags
@@ -22,7 +22,7 @@ tags:
2222
<txp:lang />
2323
~~~
2424

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).
2626

2727
## Attributes
2828

@@ -43,6 +43,6 @@ This tag has no attributes of its own. It accepts only the {% include atts-globa
4343
</head>
4444
~~~
4545

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.
4747

4848
Other tags used: [page_title](/tags/page_title), [text](/tags/text).

tags/link_to_home.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,7 @@ In this mode it operates identically to [site_url](/tags/site_url).
3333

3434
## Attributes
3535

36-
Tag will accept the following attributes (**case-sensitive**) as well as the {% include atts-global-link.html %}:
37-
38-
### Common presentational attributes
39-
40-
These attributes, which affect presentation, are shared by many tags. Note that default values can vary among tags.
41-
42-
* `class="class name"`
43-
CSS class attribute to apply to the anchor. Will be ignored if used as a single tag.
44-
Default: unset.
36+
This tag has no attributes of its own. It accepts only the {% include atts-global-link.html %}.
4537

4638
## Examples
4739

tags/link_to_next.md

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,37 +52,50 @@ Tag will accept the following attributes (**case-sensitive**) as well as the {%
5252
### Example 1: Link to next article using the article title
5353

5454
~~~ html
55-
<txp:link_to_next>
55+
<txp:link_to_next wraptag="div" class="nav_next">
5656
<txp:title />
5757
</txp:link_to_next>
5858
~~~
5959

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
6166

6267
~~~ html
6368
<txp:link_to_next showalways="1">
6469
Next
6570
</txp:link_to_next>
6671
~~~
6772

73+
or to display the text in the current site language:
74+
75+
~~~ html
76+
<txp:link_to_next showalways="1">
77+
<txp:text item="next" />
78+
</txp:link_to_next>
79+
~~~
80+
6881
This will always display the text 'Next', even when there is no next article.
6982

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.
7184
{: .alert-block .information}
7285

7386
### Example 3: Customising links
7487

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.
7689

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:
7891

7992
~~~ html
8093
<a class="link--next" href="<txp:link_to_next />" title="<txp:next_title />">
8194
Next article →
8295
</a>
8396
~~~
8497

85-
Other tags used: [prev_title](/tags/next_title), [title](/tags/title).
98+
Other tags used: [next_title](/tags/next_title).
8699

87100
## Genealogy
88101

tags/link_to_prev.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,16 @@ Tag will accept the following attributes (**case-sensitive**) as well as the {%
5252
### Example 1: Link to previous article using its title
5353

5454
~~~ html
55-
<txp:link_to_prev>
55+
<txp:link_to_prev wraptag="div" class="nav_prev">
5656
<txp:title />
5757
</txp:link_to_prev>
5858
~~~
5959

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+
6065
### Example 2: Link to previous article using static text
6166

6267
~~~ html
@@ -65,24 +70,32 @@ Tag will accept the following attributes (**case-sensitive**) as well as the {%
6570
</txp:link_to_prev>
6671
~~~
6772

73+
or to display the text in the current site language:
74+
75+
~~~ html
76+
<txp:link_to_prev showalways="1">
77+
<txp:text item="prev" />
78+
</txp:link_to_prev>
79+
~~~
80+
6881
This will always display the text 'Previous', even when there is no previous article.
6982

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.
7184
{: .alert-block .information}
7285

7386
### Example 3: Customising links
7487

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.
7689

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:
7891

7992
~~~ html
8093
<a class="link--prev" href="<txp:link_to_prev />" title="<txp:prev_title />">
8194
← Previous article
8295
</a>
8396
~~~
8497

85-
Other tags used: [prev_title](/tags/prev_title), [title](/tags/title).
98+
Other tags used: [prev_title](/tags/prev_title).
8699

87100
## Genealogy
88101

tags/newer.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,11 @@ tags:
2121
<txp:newer />
2222
~~~
2323

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.
2525

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).
2727

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.
3129

3230
Note: This tag is context-sensitive, meaning it will only fetch content from the section or category being viewed.
3331
{: .alert-block .information}
@@ -36,11 +34,6 @@ Note: This tag is context-sensitive, meaning it will only fetch content from the
3634

3735
Tag will accept the following attributes (**case-sensitive**) as well as the {% include atts-global-link.html %}:
3836

39-
`escape="html"` <span class="footnote warning">v4.3.0+</span>
40-
: Escape [HTML entities](https://developer.mozilla.org/en-US/docs/Glossary/Entity) such as `<`, `>` and `&`.
41-
: **Values:** See the [tag escaping](/tags/learning/#tag-escaping) documentation for all possible values.
42-
: **Default:** `html`.
43-
4437
`rel="text"` <span class="footnote warning">v4.7.0+</span>
4538
: [HTML rel attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes) to be applied to link.
4639
: **Default:** unset.
@@ -62,6 +55,12 @@ Tag will accept the following attributes (**case-sensitive**) as well as the {%
6255
<txp:newer rel="prev">Newer</txp:newer>
6356
~~~
6457

58+
or, to render the text in the current site language:
59+
60+
~~~ html
61+
<txp:newer rel="prev"><txp:text item="newer" /></txp:newer>
62+
~~~
63+
6564
### Example 2: Single tag - link with image
6665

6766
~~~ html

tags/older.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,9 @@ tags:
2121
<txp:older />
2222
~~~
2323

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
2525

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).
2927

3028
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.
3129

@@ -36,11 +34,6 @@ Note: This tag is context-sensitive, meaning it will only fetch content from the
3634

3735
Tag will accept the following attributes (**case-sensitive**) as well as the {% include atts-global-link.html %}:
3836

39-
`escape="html"` <span class="footnote warning">v4.3.0+</span>
40-
: Escape [HTML entities](https://developer.mozilla.org/en-US/docs/Glossary/Entity) such as `<`, `>` and `&`.
41-
: **Values:** See the [tag escaping](/tags/learning/#tag-escaping) documentation for all possible values.
42-
: **Default:** `html`.
43-
4437
`rel="text"` <span class="footnote warning">v4.7.0+</span>
4538
: [HTML rel attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes) to be applied to link.
4639
: **Default:** unset.
@@ -62,6 +55,12 @@ Tag will accept the following attributes (**case-sensitive**) as well as the {%
6255
<txp:older rel="next">Older</txp:older>
6356
~~~
6457

58+
or, to render the text in the current site language:
59+
60+
~~~ html
61+
<txp:older rel="next"><txp:text item="older" /></txp:older>
62+
~~~
63+
6564
### Example 2: Single tag - link with image
6665

6766
~~~ html

tags/popup.md

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ layout: document
33
category: Tags
44
published: true
55
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.
77
tags:
88
- Navigation tags
99
---
@@ -21,53 +21,43 @@ tags:
2121
<txp:popup />
2222
~~~
2323

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.
2525

2626
## Attributes
2727

2828
Tag will accept the following attributes (**case-sensitive**) as well as the {% include atts-global-link.html %}:
2929

3030
`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"`.
3232
: **Default:** unset.
3333

3434
`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"`.
3636
: **Values:** `0` (no) or `1` (yes).
3737
: **Default:** `0`.
3838

3939
`type="type"`
4040
: **Values:** `section`, `category`.
4141
: **Default:** `category`.
4242

43-
### Common presentational attributes
44-
45-
These attributes, which affect presentation, are shared by many tags. Note that default values can vary among tags.
46-
47-
`class="class name"` <span class="footnote warning">v4.3.0+</span>
48-
: HTML `class` to apply to the `wraptag` attribute value.
49-
: **Default:** tag name or unset (see [class cross-reference](/tags/tag-attributes-cross-reference#class)).
50-
51-
`label="text"`
52-
: Label prepended to item.
53-
: **Default:** unset (but see [label cross-reference](/tags/tag-attributes-cross-reference#label) for exceptions).
54-
55-
`wraptag="element"`
56-
: HTML element to wrap (markup) list block, specified without brackets (e.g. `wraptag="ul"`).
57-
: **Default:** unset (but see [wraptag cross-reference](/tags/tag-attributes-cross-reference#wraptag) for exceptions).
58-
5943
## Examples
6044

6145
### Example 1: Browse by category popup selector
6246

6347
~~~ html
64-
<txp:popup type="category" wraptag="p" />
48+
<txp:popup type="category" wraptag="div" />
49+
~~~
50+
51+
### Example 2: Browse by section popup selector
52+
53+
~~~ html
54+
<txp:popup type="section" wraptag="div" class="site_browse" />
6555
~~~
6656

67-
### Example 2: Popup selector with custom label
57+
### Example 3: Popup selector with custom label that filters by current section
6858

6959
~~~ html
70-
<txp:popup label="Browse this site" type="category" wraptag="p" />
60+
<txp:popup label="Browse by category" type="category" this_section />
7161
~~~
7262

7363
## Genealogy

tags/text.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,17 @@ tags:
2121
<txp:text />
2222
~~~
2323

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.
2525

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.
2727
{: .alert-block .information}
2828

2929
## Attributes
3030

3131
Tag will accept the following attributes (**case-sensitive**) as well as the {% include atts-global-link.html %}:
3232

33-
`escape="html"` <span class="footnote warning">v4.6.0+</span>
34-
: 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-
3833
`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.
4035

4136
## Examples
4237

@@ -48,7 +43,17 @@ Tag will accept the following attributes (**case-sensitive**) as well as the {%
4843
</txp:older>
4944
~~~
5045

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.
5257

5358
Other tags used: [older](/tags/older).
5459

0 commit comments

Comments
 (0)