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: build/content-types.md
+24Lines changed: 24 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -186,6 +186,30 @@ There are two ways to duplicate an article:
186
186
187
187
You should remove the article ID from the title field prior to publishing the cloned articles.
188
188
189
+
### Context awareness: tags and content interaction
190
+
191
+
Textpattern is context aware, based on information given in the URL, among other signals at the individual tag level. Although there are many URL schemes - one default scheme set in Preferences, that can be optionally overridden per section - the general principle is that Textpattern knows the difference between a landing page (list of content) and an individual article. This allows you to display different content based on what the visitor wants to see.
192
+
193
+
example.org/recipes/
194
+
: This is a landing page that will put Textpattern in _article list_ context. You might elect to display 6 of your most recent articles here as a lists, with title, excerpt and a thumbnail extracted from the article content.
195
+
example.org/recipes/scrumptious-bannoffe-pie
196
+
: This triggers _individual article_ context, perhaps clicked by a visitor from the landing page in the recipes section. Here, you might showy one or more photographs in a gallery of the pie in various stages of completion, and display the ingredients and method from the Body of the article.
197
+
example.org/category/puddings
198
+
: This might be a landing page when someone clicked the 'Puddings' category from the individual article above. It would put the site in _category list_ context and you could show a list of all recipes that have the 'puddings' category selected.
199
+
example.org/author/Kim+Supercake
200
+
: This triggers _author list_ context. Perhaps you have a number of contributors to the site, and on your article list or individual article page you use the `<txp:author />` tag to show who each recipe is by. If the bannoffe pie was weritten by Kim Supercake, the visitor could then be shown a list of other recipes by this cook.
201
+
202
+
All of the the above examples use the same `<txp:article />` tag, but it behaves differently depending on what type of content the URL indicates. The conditional tags such as:
203
+
204
+
*`<txp:if_article_list>`
205
+
*`<txp:if_individual article>`
206
+
*`<txp:if_catgeory>`
207
+
*`<txp:if_author>`
208
+
209
+
can be used to choose what your pages do based on their context, so you can switch between displaying article, category, and author lists or individual article content.
210
+
211
+
Content thus goes hand in hand with the design and layout of the site, and you can select which parts of an article are displayed in each context to allow visitors to more easily find information.
0 commit comments