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, 03:41 PM #

  3. > This also include the code for the comment form if you would like to _ fix up_ the tabindex.

    What’s the tabindex? (the order in which things are highlighted when you press <tab>?>
    The _ fix up_ link doesn’t work

    > wrap your comments in a div or otherwise modify the commenting system.

    What are comments? What I’m writing right now?

    As a [retired] technical writer I can say that it’s not not a good idea to introduce new terminology without defining it.

    (I’m approaching txp very gingerly. The exisiting site I work on is written in straight html/css but I think perhaps cms might be a better way to go. would give others the ability to edit pages…)

    harryg

    Apr 9, 01:00 AM #

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: Philosophy

    Daniel Black, author of Erectlocution, was kind enough to chat with me one day and we had a great discussion – have a listen.

    Read More

  • 260.

    The Stuff in Between

    I’m actually almost normal when not agonizing over robot production details, and quite a bit has happened since I last wrote an update. First, I’ve finally graduated. I had a bit of a...

    Read More

  • 260.

    The Ethics of AI: Part Three

    Is it ethical (or possible) to constrain intelligent life? This part of the argument involves what we think it means to be human, and whether creating and adjusting those criteria in an AI affects...

    Read More

  • 260.

    The Ethics of AI: Part Two

    Is it ethical to allow humanity to continue, or to replace our species with machines? This is getting tougher. Why does humanity deserve to exist? The recorded history of the experiences of Homo...

    Read More

  • 260.

    The Ethics of AI: Part One

    Is it ethical to create consciousness? In this discussion, I will make the assumption that we can be assured these beings are “personally” intelligent (i.e. just like us). As we see in nature,...

    Read More

  • 260.

    The Ethics of Artificial Intelligence

    I am beginning a series exploring some ethical concerns associated with the development of artificial intelligence. Neurobiological evidence points firmly to the brain as the source of human...

    Read More

  • 260.

    The Atheist's Purpose

    As a lot of the content on this site suggests, I’m an atheist. Being an atheist can be a bit contentious, as many find the lack of an explicit purpose or codified moral laws wrong. So, I’d like...

    Read More

  • 260.

    Conscious Conversation: Computation

    Dr. Rapaport is an associate professor in the Department of Computer Science and Engineering at the University at Buffalo with research interests in Computer Science, Artificial Intelligence,...

    Read More