THETEXTPATTERNENGINE

Part 2: The Textpattern Engine

This article is about the Textpattern CMS itself and what you should know about it. The Wikipedia Article covers its basic history if you’re interested; otherwise, let’s get started.

The file structure is fairly simple. Areas seen by the public are in the root directory while the engine itself is found in the “textpattern” directory.

You will most likely not have to edit anything, because almost anything can be accomplished through the variety of tags or plugins available. However, if you do find the need to hack your site into perfection, it’s good to know where the important files are.

Obviously, anything related to comments is found in the “publish/comment.php” file. This also include the code for the comment form if you would like to fix up the tabindex. This is also the place to go if you want to wrap your comments in a div or otherwise modify the commenting system.

Another important file handles all of the tags used within the CMS and can be found at “publish/taghandlers.php”. You would only have to modify anything in this file if the tags output or function is not exactly what you’re looking for. For example, on my home page, I modified the <txp:comments_invite /> tag such that the invite text and count would be contained in the anchor. The file is very well commented and you can find the particular tag handler you’re looking for by searching for the name (ex. I searched for “comments_invite” in the example above).

Obviously, you might make some modifications to the root “index.php” in order to have an effect on all pages produced. Some people add their statistics code in this file for example.

Update: I neglected to mention an important aspect of Textpattern, it’s language file. The language information controls almost all of the actual words outputted by the CMS ranging from error messages to administrator-side text. Actually, in recent versions, it has lost it’s “file” status and has been integrated in the main database. It is helpful to know how to modify this if you want to personalize your site; for example, if you wanted to change the default “Thank you” response for comments, you would do a search (in PHPMyAdmin or similar) in the “txp_lang” table of your database for the text and replace it with whatever you want.

That’s pretty much it for the Textpattern Engine. If I missed something or would like me to elaborate on a specific part, leave a comment below.

  1. its breaking my mind

    cashmaniac

    Feb 21, 06:24 PM #

  2. Hi everyone,
    just downloaded TXP, made some changes in the defult page and CSS. How can I preview what I have done so far? I don’t have URL for my site yet though.

    Thanx in advance!

    cosmique

    Mar 23, 04:41 PM #

Add a Comment

Phrase modifiers:

_emphasis_
*strong*
__italic__
**bold**
??citation??
-deleted text-
@code@

Block modifiers:

bq. Blockquote
p. Paragraph

Links:

"linktext":http://example.com


Show Articles By:

You can show articles by time or category.

  • 260.

    Conscious Conversation: Computation

    This interview is part of a series exploring what different people think about consciousness. The plan is to pose the same basic question to people of different backgrounds (philosophers, religious...

    Read More

  • 260.

    State of the Species

    My fellow humans, we’ve come a long way. Throughout our brief history on earth, we’ve tried to come to terms with a remarkable ability, its source, and what best to do with it. Through relatively...

    Read More

  • 260.

    Conscious Conversation: Science

    This interview is the first of a series exploring what different people think about consciousness. The plan is to pose the same basic question to people of different backgrounds (philosophers,...

    Read More

  • 260.

    On Subjectivity

    Science places a heavy emphasis on the objectivity of the physical world. As a result, consciousness, and specifically its subjective aspect, is often understandably ignored. What interests us is not...

    Read More

  • 260.

    Just Animated Stardust

    “Through science, we human beings are able to grasp at least some of nature’s secrets. We have cracked part of the cosmic code. Why this should be, just why Homo sapiens should carry the spark of...

    Read More

  • 260.

    Prodigious Savants and their Abilities

    Savant syndrome, a condition occurring most often in autistic patients, is a rare disorder where mentally retarded individuals have incredible abilities in isolated fields like memory, mathematics,...

    Read More

  • 260.

    Why Medicine Again?

    Medicine isn’t what it used to be. I’ve talked to alot of physicians, researchers and residents recently and I’m not encouraged by what I’ve heard. What seems to motivate many...

    Read More

  • 260.

    What of the Soul?

    I received a question recently that asked what I thought about the existence of a soul given the relative secularity of most of the content on this site. Soul, Mind, whatever you call it refers...

    Read More