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: brand/user-docs-guide.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -167,7 +167,7 @@ These types of strings are uniquely preferences labels (a.k.a. settings) in the
167
167
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.
168
168
{:.example}
169
169
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.
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.
Copy file name to clipboardExpand all lines: tags/article_image.md
+5-15Lines changed: 5 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,6 +48,10 @@ Tag will accept the following attributes (**case-sensitive**):
48
48
: **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).
49
49
: **Default:** unset.
50
50
51
+
`style="style rule"`
52
+
: Inline CSS `style` rule. It's recommended that you assign CSS rules via the `class` attribute instead.
@@ -57,21 +61,7 @@ Tag will accept the following attributes (**case-sensitive**):
57
61
: 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).
58
62
: **Default:** width of image stored in the database.
59
63
60
-
### Common presentational attributes
61
-
62
-
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/category2.md
+19-23Lines changed: 19 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: 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.
7
7
tags:
8
8
- Article tags
9
9
- Navigation tags
@@ -22,13 +22,13 @@ tags:
22
22
<txp:category2 />
23
23
~~~
24
24
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.
26
26
27
27
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.
28
28
29
29
## Attributes
30
30
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 %}:
32
32
33
33
`link="boolean"`
34
34
: 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**):
50
50
: **Values:**`0` (no, allow from any section) or `1` (yes).
51
51
: **Default:**`0`.
52
52
53
-
### Common presentational attributes
54
-
55
-
These attributes, which affect presentation, are shared by many tags. Note that default values can vary among tags.
: 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
-
65
53
## Examples
66
54
67
55
### Example 1: Category name in plain text
@@ -76,28 +64,36 @@ These attributes, which affect presentation, are shared by many tags. Note that
76
64
77
65
~~~html
78
66
<p>
79
-
<txp:category2link="1"title="1" />
67
+
<txp:category2linktitle />
80
68
</p>
81
69
~~~
82
70
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
84
74
85
-
### Example 3: Container example
75
+
~~~html
76
+
<txp:category2wraptag="p">Other articles in category:
Copy file name to clipboardExpand all lines: tags/custom_field.md
+5-16Lines changed: 5 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,24 +23,13 @@ tags:
23
23
24
24
The **custom_field** tag is a *single* tag and used to display the contents of a custom field.
25
25
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:
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.
30
27
31
28
Also see the [if_custom_field](/tags/if_custom_field) conditional tag, which provides more flexibility and power using custom fields.
32
29
33
30
## Attributes
34
31
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 %}:
44
33
45
34
`name="fieldname"`
46
35
: Display specified custom field.
@@ -74,14 +63,14 @@ HTML returned would be:
74
63
</p>
75
64
~~~
76
65
77
-
### Example 2: Power A linklog
66
+
### Example 2: Power a linklog
78
67
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:
: Whether to display the full-size (0) or thumbnail-size (1) image.
60
64
: **Default:** 0.
@@ -66,21 +70,7 @@ Tag will accept the following attributes (**case-sensitive**):
66
70
: 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).
67
71
: **Default:** width of image stored in the database.
68
72
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.
0 commit comments