Skip to content

Commit a4df59f

Browse files
committed
Merge branch 'master' into self-hosted
2 parents 402a484 + fa181a2 commit a4df59f

18 files changed

+131
-139
lines changed

_includes/atts-common.html

Lines changed: 0 additions & 13 deletions
This file was deleted.

_includes/atts-global-link.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<a href="https://docs.textpattern.com/tags/learning/#global-attributes-list">{% if include.text == null %}global attributes{% else %}{% include.text %}{% endif %}</a>

brand/user-docs-guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ These types of strings are uniquely preferences labels (a.k.a. settings) in the
167167
Widowed words happen when the last word of a title wraps to a new line by itself. You may not like it. Prevent widowed words from happening by selecting ‘Yes’ for the *Prevent widowed words in article titles?* preference in the Publish section of the Preferences panel.
168168
{:.example}
169169

170-
As in earlier examples, additional strings are used (correctly) and lots of context is involved to make them clear. The string were concerned with here is the preference label posed as a question, distinguished by emphasized text. Without the emphasis, the string would be much harder to see and understand.
170+
As in earlier examples, additional strings are used (correctly) and lots of context is involved to make them clear. The string we're concerned with here is the preference label posed as a question, distinguished by emphasized text. Without the emphasis, the string would be much harder to see and understand.
171171

172172
### Option strings
173173

build/content-types.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
layout: document
3+
category: Construction and Presentation
4+
published: false
5+
title: Content types
6+
description: Core content types, custom content types, and designing site architectures with these kinds of content needs in mind.
7+
---
8+
9+
# Content Types
10+
11+
Intro...
12+
13+
**Contents**
14+
15+
* Table of contents
16+
{:toc}
17+
18+
## Articles
19+
20+
## Images
21+
22+
## Files
23+
24+
## Links
25+
26+
## Comments
27+
28+
## Authors
29+
30+
## Categories
31+
32+
## Custom fields
33+
34+
Custom fields enable you to add site-specific content to your articles that extend the scope of the core fields defined above.
35+
36+
### Defining custom fields
37+
38+
On the Preferences panel, click the **Custom fields** item to see input text boxes for defining up to ten fields that will appear on the Write panel when defined.
39+
40+
#### Important notes on creating custom field names
41+
42+
Custom field names may include letters (uppercase or lowercase), numbers, and under scores, but no spaces or other special characters should be used. For example, `custom1`, `Custom1`, `Custom_1`, `Location` and `Project_name` are all valid name constructs, while `custom 1`, `custom !` and `Project name` are not.
43+
44+
Also, there are certain names **reserved** by Textpattern, which should *not* be used to name custom fields. Doing so will likely cause your site to not work as expected.
45+
46+
**Do not use the following for custom field names**:
47+
48+
* annotate
49+
* article_image
50+
* authorid
51+
* body
52+
* category
53+
* category1
54+
* category2
55+
* comments_count
56+
* comments_invite
57+
* excerpt
58+
* form
59+
* id
60+
* keywords
61+
* limit
62+
* offset
63+
* posted
64+
* section
65+
* sort
66+
* status
67+
* thisid
68+
* title
69+
* url_title
70+
* Or any other [tag attribute](/tags/tag-attributes-cross-reference), just in case!
71+
72+
A symptom of a name clash is when you go to check or display the contents of a custom field in an article and receive unexpected (or no) output. In this case, make sure your custom field names are not any of the reserved names listed above.
73+
74+
To remove a custom field, simply clear its name and save the changes.
75+

tags/article_image.md

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ Tag will accept the following attributes (**case-sensitive**):
4848
: **Values:** `lazy` (defers loading the image until it reaches a calculated distance from the viewport, as defined by the browser), `eager` (loads the image immediately, regardless of whether or not the image is currently within the visible viewport).
4949
: **Default:** unset.
5050

51+
`style="style rule"`
52+
: Inline CSS `style` rule. It's recommended that you assign CSS rules via the `class` attribute instead.
53+
: **Default:** unset.
54+
5155
`thumbnail="boolean"` <span class="footnote warning">v4.0.4+</span>
5256
: Use the thumbnail rather than full-size image.
5357
: **Values:** `0` (no) or `1` (yes).
@@ -57,21 +61,7 @@ Tag will accept the following attributes (**case-sensitive**):
5761
: Specify an image `width` which overrides the value stored in the database. Use `width="0"` to turn off the output of a width attribute in the `<img>` tag (thus the browser will scale the width if a height is used).
5862
: **Default:** width of image stored in the database.
5963

60-
### Common presentational attributes
61-
62-
These attributes, which affect presentation, are shared by many tags. Note that default values can vary among tags.
63-
64-
`class="class name"` <span class="footnote warning">v4.0.4+</span>
65-
: CSS `class` attribute to apply to the image (or to the `wraptag`, if set).
66-
: **Default:** unset (see [class cross-reference](/tags/tag-attributes-cross-reference#class)).
67-
68-
`style="style rule"`
69-
: Inline CSS `style` rule. It's recommended that you assign CSS rules via `class` attribute instead.
70-
: **Default:** unset.
71-
72-
`wraptag="tag"` <span class="footnote warning">v4.0.4+</span>
73-
: HTML tag to be used to wrap the `<img>` tag, specified without brackets (e.g. `wraptag="p"`).
74-
: **Default:** unset (but see [wraptag cross-reference](/tags/tag-attributes-cross-reference#wraptag) for exceptions).
64+
{% include atts-global.html %}
7565

7666
## Examples
7767

tags/category1.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ This tag may be used within either an article form, or in a page, wrapped in an
2828

2929
## Attributes
3030

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

3333
`link="boolean"`
3434
: Whether to link to articles from the same category. Works only in the *single* tag.
@@ -50,10 +50,6 @@ Tag will accept the following attributes (**case-sensitive**):
5050
: **Values:** `0` (no, allow from any section) or `1` (yes).
5151
: **Default:** `0`.
5252

53-
{% include atts-common.html breakby="" %}
54-
55-
{% include atts-global.html %}
56-
5753
## Examples
5854

5955
### Example 1: Category name in plain text

tags/category2.md

Lines changed: 19 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: Category2
6-
description: The category2 tag will display information of the category as defined by 'Category 2' of the article being displayed.
6+
description: The category2 tag will display the category as defined by 'Category 2' in the article being displayed.
77
tags:
88
- Article tags
99
- Navigation tags
@@ -22,13 +22,13 @@ tags:
2222
<txp:category2 />
2323
~~~
2424

25-
The **category2** tag can be used as either a *single* tag or *container* tag. It will display information of the category as defined by **Category 2** of the article being displayed. When used as a containing tag, it will turn the contents into a link to that category. Otherwise, it will return plain text.
25+
The **category2** tag can be used as either a *single* tag or *container* tag. It will display the category as defined by **Category 2** in the article being displayed. When used as a container tag, it will turn the contents into a link to that category. Otherwise, it will return plain text.
2626

2727
This tag may be used within either an article form, or in a page, wrapped in an [if_individual_article](/tags/if_individual_article) conditional tag.
2828

2929
## Attributes
3030

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

3333
`link="boolean"`
3434
: Whether to link to articles from the same category. Works only in the *single* tag.
@@ -50,18 +50,6 @@ Tag will accept the following attributes (**case-sensitive**):
5050
: **Values:** `0` (no, allow from any section) or `1` (yes).
5151
: **Default:** `0`.
5252

53-
### Common presentational attributes
54-
55-
These attributes, which affect presentation, are shared by many tags. Note that default values can vary among tags.
56-
57-
`class="class name"` <span class="footnote warning">v4.0.4+</span>
58-
: HTML `class attribute` to be applied to `wraptag`.
59-
: **Default:** unset (see [class cross-reference](/tags/tag-attributes-cross-reference#class)).
60-
61-
`wraptag="tag"` <span class="footnote warning">v4.0.4+</span>
62-
: HTML tag to wrap around output, specified without brackets (e.g. `wraptag="p"`).
63-
: **Default:** unset (but see [wraptag cross-reference](/tags/tag-attributes-cross-reference#wraptag) for exceptions).
64-
6553
## Examples
6654

6755
### Example 1: Category name in plain text
@@ -76,28 +64,36 @@ These attributes, which affect presentation, are shared by many tags. Note that
7664

7765
~~~ html
7866
<p>
79-
<txp:category2 link="1" title="1" />
67+
<txp:category2 link title />
8068
</p>
8169
~~~
8270

83-
If **category2** is 'Specific stuff', this tag will display the words 'Specific stuff' as a hyperlink to a list of articles in the same category.
71+
If **category2** is defined with a title 'Security advice', this tag will display the words 'Security advice' as a hyperlink to a list of articles in the same category.
72+
73+
### Example 3: Category link using custom container content
8474

85-
### Example 3: Container example
75+
~~~ html
76+
<txp:category2 wraptag="p">Other articles in category:
77+
<txp:category2 title /></txp:category2>
78+
~~~
79+
80+
Might display this HTML:
8681

8782
~~~ html
8883
<p>
89-
<txp:category2>Other articles in category:
90-
<txp:category2 title="1" /></txp:category2>
91-
</p>
84+
<a rel="tag" href="https://example.com/category/security-advice/">
85+
Other articles in category: Security advice
86+
</a>
87+
<p>
9288
~~~
9389

9490
### Example 4: Category 1 and 2
9591

9692
~~~ html
9793
<p>
98-
Filed in: <txp:category1 link="1" title="1" />
94+
Filed in: <txp:category1 link title />
9995
<txp:if_article_category number="2">
100-
and <txp:category2 link="1" title="1" />
96+
and <txp:category2 link title />
10197
</txp:if_article_category>
10298
</p>
10399
~~~

tags/custom_field.md

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,13 @@ tags:
2323

2424
The **custom_field** tag is a *single* tag and used to display the contents of a custom field.
2525

26-
Custom fields are useful when you need to output content having a consistent structure, usually in context to a particular type of article. Custom fields are defined in the [Preferences panel](/administration/preferences-panel), and used in the [Write panel](/administration/write-panel). There are conditions to be aware of in each case, so be sure to read the following sections, respectively:
27-
28-
1. [Defining custom fields](/administration/preferences-panel#custom-fields-preferences)
29-
2. @@Adding custom field data@@
26+
Custom fields are useful when you need to output content having a consistent structure, usually in context to a particular type of article. Custom fields are defined in the Preferences panel, and used in the Write panel. There are conditions to be aware of in each case, so be sure to read the [Defining custom fields](/build/content-types#defining-custom-fields) information.
3027

3128
Also see the [if_custom_field](/tags/if_custom_field) conditional tag, which provides more flexibility and power using custom fields.
3229

3330
## Attributes
3431

35-
Tag will accept the following attributes (**case-sensitive**):
36-
37-
`default="value"`
38-
: Default value to use when field is empty.
39-
40-
`escape="html"`
41-
: Escape [HTML entities](https://developer.mozilla.org/en-US/docs/Glossary/Entity) such as `<`, `>` and `&` prior to echoing the field contents.
42-
: **Values:** See the [tag escaping](/tags/learning/#tag-escaping) documentation for all possible values.
43-
: **Default:** `html`.
32+
Tag will accept the following attributes (**case-sensitive**) as well as the {% include atts-global-link.html %}:
4433

4534
`name="fieldname"`
4635
: Display specified custom field.
@@ -74,14 +63,14 @@ HTML returned would be:
7463
</p>
7564
~~~
7665

77-
### Example 2: Power A linklog
66+
### Example 2: Power a linklog
7867

79-
With an article title of `Textpattern`, an excerpt of `Textpattern is awesome!`, a custom field named `link` containing `https://textpattern.com/`, and an 'article' type form like the following:
68+
With an article title of `Textpattern`, an excerpt of `Textpattern is awesome!`, a custom field named `Link_url` containing `https://textpattern.com/`, and an 'article' type form like the following:
8069

8170
~~~ html
8271
<article class="linklog-entry">
8372
<h1>
84-
<a href="<txp:custom_field name="Link" />"><txp:title /></a>
73+
<a href="<txp:custom_field name="Link_url" />"><txp:title /></a>
8574
</h1>
8675
<p>
8776
<time datetime="<txp:posted format="iso8601" />" itemprop="datePublished">

tags/expires.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ The **expires** tag is a *single* tag used to indicate when an article should no
2525

2626
## Attributes
2727

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

3030
`format="format string"`
3131
: Override the default date format set in the Preferences panel.
@@ -42,8 +42,6 @@ Tag will accept the following attributes (**case-sensitive**):
4242
: **Values:** locales adhere to [ISO-639](https://en.wikipedia.org/wiki/ISO_639-2).
4343
: **Default:** unset (time format set in the Preferences panel.
4444

45-
{% include atts-global.html %}
46-
4745
## Examples
4846

4947
### Example 1: Custom format date setting

tags/image.md

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ Tag will accept the following attributes (**case-sensitive**):
5555
`name="image name"`
5656
: Specifies which image to display by its image `name` as shown on the Images panel.
5757

58+
`style="style rule"`
59+
: Inline CSS `style` rule. It's recommended that you assign CSS rules via the `class` attribute instead.
60+
: **Default:** unset.
61+
5862
`thumbnail="boolean"` <span class="footnote warning">v4.8.0+</span>
5963
: Whether to display the full-size (0) or thumbnail-size (1) image.
6064
: **Default:** 0.
@@ -66,21 +70,7 @@ Tag will accept the following attributes (**case-sensitive**):
6670
: Specify an image `width` which overrides the value stored in the database. Use `width="0"` to turn off the output of a width attribute in the `<img>` tag (thus the browser will scale the width if a height is used).
6771
: **Default:** width of image stored in the database.
6872

69-
### Common presentational attributes
70-
71-
These attributes, which affect presentation, are shared by many tags. Note that default values can vary among tags.
72-
73-
`class="class name"`
74-
: HTML `class` to apply to the `wraptag` attribute value, if set, otherwise to the `<img>` tag.
75-
: **Default:** unset (see [class cross-reference](/tags/tag-attributes-cross-reference#class)).
76-
77-
`style="style rule"`
78-
: Inline CSS `style` rule. It's recommended that you assign CSS rules via `class` attribute instead.
79-
: **Default:** unset.
80-
81-
`wraptag="element"` <span class="footnote warning">v4.0.4+</span>
82-
: HTML tag to be used to wrap the `<img>` tag, specified without brackets (e.g. `wraptag="ul"`).
83-
: **Default:** unset (but see [wraptag cross-reference](/tags/tag-attributes-cross-reference#wraptag) for exceptions).
73+
{% include atts-global.html %}
8474

8575
## Examples
8676

0 commit comments

Comments
 (0)