Acquisition and Installation category listing. ­ Textpattern CMS

FAQ: Acquisition and Installation

How do I create a MySQL database?

QUESTION:

I get an “Access denied for user” error during installation.
I get a mysql_connect error during installation.



ANSWER:

As mentioned in the brief installation instructions, Textpattern requires a MySQL database and user to be created before installation.

The procedure for creating a database and user varies between hosting companies. Some hosts will create one for you. Others provide a control panel like cPanel or Webmin with a MySQL management section. You’ll need to read the documentation provided by your host for more information.

You don’t need to do anything other than create an empty database and a user with sufficient permissions to create and modify tables.

Once you have created or located your database, run the Textpattern installer and follow its directions. (See also: Detailed Installation Instructions.)

If you receive an “Access denied” or mysql_connect error during installation, it usually means that one or more of the MySQL parameters (host, database name, user name, password) are incorrect. Double check those values, and consult your hosting company’s technical support resources if problems persist.

Where can I see Textpattern in action?

QUESTION:

What does Textpattern look like?
Is there an online demo I can try?
Where can I see some examples of Textpattern web sites?



ANSWER:

There’s an online demonstration of Textpattern.

You’ll find Textpattern templates available for download and Textplates.com. The preview galleries provide good examples of the range of page layouts and styles made possible by Textpattern’s template system.

Txp Magazine maintains a showcase of selected Textpattern powered web sites.

How do I fetch the current development version?

QUESTION:

How do I fetch the latest copy of Textpattern from Github?
Which branch or release should I use?
Where can I get old versions of Textpattern?



ANSWER:

The Textpattern source code is stored in a git repository at Github. The important endpoints are:

releases – contains a copy of most official Textpattern releases, identical to the .zip/.tar.gz downloads. This is mostly useful if you’re looking for an older version.

master – the main 4.x branch. This is where we work towards each new release (4.5.0, 4.6.0 etc). Please note that, while the 4.x branch is intended to be stable and reliable, the changes between releases occasionally include errors or omissions. If you’re looking for the most reliable current copy of Textpattern, use the latest release.

To download from Github, you’ll need to install the git command-line client (for most operating systems, including OS X). There are graphical clients available, such as Github for Windows or OSX should you prefer, although the command-line version gives far more flexibility.

The command you need to get started is:

$ git clone https://github.com/textpattern/textpattern.git

That will clone the repository to your machine, you can use git config to set up a few things like your user.name and user.email, then you’re free to make changes, publish them to your own github repo and issue a Pull Request for us to merge your changes, or just create a diff patch and send it to us.

Note there are experimental branches that contain new features in development that are not ready to merge into the master branch yet. Feel free to peruse these using:

$ git checkout name-of-branch

You can see the list of available branches using the git branch command. To get back to your master copy, use git checkout master.

Where are the installation instructions?

The installation instructions on the download page are brief but accurate.

There are some step-by-step instructions at Textbook.

Make sure you have the following before trying to install Textpattern:

  1. The name of a MySQL database.
  2. A username and password that is sufficient to access the database.
  3. The hostname for your MySQL server. This is almost always localhost.

I've installed Textpattern. Now what?

QUESTION:

I’m confused about how Textpattern organizes things
Sections, pages, forms – please explain!



ANSWER:

Textpattern is a blank slate. Though it almost always works out-of-the-box, and includes a simple layout and structure to get you started, you’ll need to learn some basic concepts in order to shape it to your needs.

Briefly, the important concepts in Textpattern are:

Sections

Sections are the topmost divisions of your web site. A newspaper site might have sections like “Politics”, “Sport”, “Weather”, and so on. These usually correspond to URLs such as http://example.com/politics/, http://example.com/sport/, etc.

Sections are managed in the Textpattern administration panel under presentation > sections.

Each section contains any number of articles. Sections can look the same, or each one can have a unique page layout.

A section page – like http://example.com/sport/ – will typically display a list of recent articles in that section, much like a weblog. It doesn’t have to be a weblog, however: it might display a single article (as in a ‘static’ page like an About page), or a list of articles organized in some other fashion (as in this FAQ section).

Articles

Articles are where you store your content. Each article has a title, excerpt, body, and can contain user-submitted comments.

Each article belongs to one section (and only one).

Every article has its own unique page and URL, usually called an individual article page or permlink page. URL modes are configurable, but it often looks like http://example.com/mysection/123/my-article-title.

To write a new article, go to content > write in the Textpattern administration panel. To edit or remove existing articles, go to content > articles.

Page Templates

Page templates determine the HTML code used to display list and individual article pages. Each section has an associated page template that’s used when displaying lists or articles in that section. You can share the same page template between multiple sections, or create a unique one for each section if you wish.

Page templates contain textpattern tags, which are used to insert dynamic content into the page. For example, the <txp:article /> tag will display the article(s) associated with the current URL.

Page templates are managed in the presentation > pages tab of the administration interface. To assign a template to a particular section, go to presentation > sections.

Forms

Forms are short snippets of HTML used to display repeated content. Each form has a type: article, link, misc, etc.

An article form is used by the <txp:article /> tag to determine how to display each article on the page, for example.

Like page templates, forms can contain Textpattern tags. The article form will typically include the <txp:title /> and <txp:body /> tags, for example, which display the article’s title and body respectively.

You can use misc forms for snippets of HTML code you use on each page, such as a header or footer. (read how)

Forms are managed in the presentation > forms administration tab.

Styles

Styles are CSS stylesheets. Like page templates, each section has an associated style. You can use a unique style for each section, or share one between many sections.

Styles are managed in the presentation > style tab. To assign a style to a section, go to presentation > sections.

The Front Page

The front page of your Textpattern site – typically http://example.com/ – works as a container for all sections. The front page has its own page template and style setting; just like sections, it can have a unique page template and style, or share them with other sections.

You can’t assign articles directly to the front page. Instead, each section has a setting (“On front page?”) that determines whether or not the articles in that section should be displayed on the front page.

Images and Files

Textpattern has a built in administration interface for uploading and managing images and files.

The content > images tab is used to upload and manage images that are displayed as content in a page, as elements in a layout, in an image gallery, or within an article body. Several built-in Textpattern tags are available for using images in a page template or form: <txp:image />, <txp:article_image />, etc.

The content > files tab is used to upload and manage files that are made available for users to download. A number of file_download template tags are available for creating file download lists.

Alternatively, you can upload and manage images or files manually using FTP and similar programs. You’ll have to use hard-coded HTML and URLs to reference these files, however. (Be careful when using relative URLs).

How do I log in?

QUESTION:

Where is the Textpattern administration panel?
I’ve forgotten where the login page is!



ANSWER:

If you’ve installed Textpattern at the root of your web site, go to http://example.com/textpattern/index.php

If Textpattern is installed in a subdirectory, try http://example.com/mysubdir/textpattern/index.php

On most servers you can leave off the index.php part.

Where can I download .htacccess?

QUESTION:

My .htaccess file is missing. Where can I get a copy?
.htaccess isn’t in the download!



ANSWER:

The .htaccess file is inside the main directory in both the .zip and .tar.gz downloads. Some file browsers (particularly on OS X) don’t display files beginning with a ‘.’ by default, but it’s there, honest.

You can also fetch it from the subversion repository.

If you’re planning on using clean URLs, you’ll need to make sure you upload this file to your web site. The safest way to do this is usually to upload the ‘textpattern-4.0.7’ folder to your server, then moving it to the correct place, rather than selecting and uploading the contents of the ‘textpattern-4.0.7’ folder.

Some servers require manual changes to .htaccess for Clean URLs to work, and others don’t support it at all. You’ll find more information in this FAQ.