Common “How Do I?” questions [todo]

Here are some quick answers to common “How Do I?” questions.

How Do I..

…display something only on an individual article page?

Surround it with an txp:if_individual_article tag:

…display something only on list (section/front) pages?

Surround it with an txp:if_article_list tag:

…make an “About” page?

FAQ: Managing Static Pages

…make a reusable sidebar, header or footer?

With the txp:output_form tag.

FAQ: How do I reuse chunks of HTML?

…show a list of recent articles or comments in a sidebar?

With the
txp:recent_articles or txp:recent_comments tags.

For more control over a list of recent articles, use txp:article_custom instead.

FAQ: “How do I change the output of txp:recent_articles?”:https://textpattern.com/faq/26/change-the-output-of-txp%3Arecent_articles

…show a short list of articles or article links in a sidebar?

For simple lists, the recent_articles tag might do what you want (see above).

To list articles from a specific section or category, use the txp:article_custom tag. Create an article form containing only the tags you want, for example:


Then use a tag like in your sidebar.

…show a short version of articles with a “read more..” link?

Use something like this in your article form:

read more..

<!-- full article body -->
<txp:body />


FAQ: How do I show only an excerpt in article lists?

Excerpts automatically generated from the article body are possible through plugins.

…break an article list into columns, or insert ads between certain articles in a list?

Use the limit, offset and pageby attributes of txp:article:


Textpattern CMS support forum: txp:article pageby attribute

…supply a special layout to the first article on a page?

Use the txp:if_first_article tag in your article form:


…apply a special layout to articles from a particular section when shown on the front page?

Use the txp:if_article_section tag in your article form:

<div class="linklog"></div>

<!-- all other sections -->
<txp:title />

<txp:body />


…apply a special layout to articles from a particular category?

Use the txp:if_article_category tag in your article form:

<div class="linklog"></div>

<!-- all other categories -->
<txp:title />
<txp:body />


…show a unique intro paragraph on each section page?

Post a “Sticky” article in each section containing the paragraph for that section, and display it with a tag.

FAQ: How do I keep a post at the top of the page?

…show the same intro paragraph on more than one section page?

Post a “Sticky” article containing the text, and display it with the tag , where 123 is the ID number of the sticky article. Enclose it with the tag if necessary.

FAQ: How do I keep a post at the top of the page?

…show a unique banner image or similar on a particular section page?

If the page layout for each section is to be identical except for a small element, you should probably share the same page template between all sections, and use the txp:if_section tag to selectively display variations:

…add a stylesheet for printing?

Create a new style named “print”, and add this to the <head> portion of your page template:

…display a random article, or a link to a random article?

Put this in your page template:

…and create an article form named “random” containing the appropriate “article tags” txp:Category:Article_Tags, e.g:

…display articles in a different order?

To sort by title in ascending alphabetical order:

To sort by Category 1 in descending order:

To sort by Category 1 first, then article date:

To sort by a custom field1:

…display “Top Stories” first, then regular articles?

Use a custom field to identify your top stories, and use this tag in your page template:

Storing numbers in custom field 5 will bring articles to the top, with higher numbers shown first.

1 You must use the custom_n name here, not the custom field name as defined in Advanced Preferences.


Kommentare 0

Die freundliche Seite zur Unterstützung der Zusammenarbeit von Menschen und Organisationen, für mehr Freiheit & Spaß.
Gegen die Spaltung der Gesellschaft !
… und für all diejenigen, die Welt ein wenig besser verlassen möchten als Sie sie vorgefunden haben!

Schön dass Du hier bist.

Hier findest Du Ideen, Anregungen und Informationen über Themen wie (informationelle) Selbstbestimmung, Internet-Sicherheit, Redefreiheit, Menschenrechte, Gesellschaftskritik, Alternative Gesellschaftsentwürfe, Krypto Währungen und vieles andere mehr…

Diese Seite befindet sich noch im Aufbau und wird deshalb ständig erweitert, verbessert und wird sich im Laufe der Zeit noch mehrfach ändern.

Derweil stelle ich hier Übersetzungen von englischen Artikeln, die mir im deutschsprachigen Raum zu unter- oder gar nicht repräsentiert erscheinen.

Viel Spaß beim Durchstöbern

Kategorien ,

Kommentare 1

What do you want to do next?

  • Write a new article? Let your creativity flow!
  • Change this site’s name, slogan or select a different article URL style? Check and modify your preferences.
  • Edit or delete this article? Your articles list is the place to start.
  • Upload images or files to accompany your articles?
  • Learn Textile, the markup generator included with Textpattern? You can try it in the Textile sandbox.
    • If you want to learn more, you can refer to an extensive Textile manual.
  • Be guided through your Textpattern first steps by completing some tasks?
  • Study the Textpattern Semantic Model?
  • Add one or more additional users, or extend Textpattern’s capabilities with plugins from the Textpattern plugin directory?
  • Dive in and learn by doing? Please note:
    • When you write an article you assign it to a section of your site.
    • Sections use a page template and a style to define how site content appears in a browser.
    • Page templates typically use HTML and Textpattern tags (like this: <txp:article />) to build the output code.
    • Some Textpattern tags use forms, reusable building blocks that provide extensive control and customization over your site construction.
    • Pages, styles and forms can be packaged into themes and assigned to one or more sections.

Textpattern tags, their attributes and values are explained within the Textpattern User Documentation, where you will also find valuable examples, advice and tutorials.

There’s also a group of friendly, helpful Textpattern users and administrators at the Textpattern support forum.

Additional language translations and corrections are welcomed. Please visit Textpattern language translations for further details.

This is an example article included with Textpattern to demonstrate some of the first steps you can undertake. An example comment is associated with this article. The article and comment can be safely deleted using the articles and comments lists.

Kategorien ,