Making Your Website’s Posts Social Bookmark-Friendly in Textpattern

A lot of state and local chapters use Textpattern for their websites. Sometimes the page templates don’t have adequate textpattern code for the titles of your posts. This means that no matter what page, article, or post is being viewed the same title will appear. While this may not seem like a big deal, it makes a difference on social bookmarking sites like I use for my links posts, as do a lot of bloggers. With some chapter sites when I go to add a post it will just show a generic title, for example if it were YDAZ every post would show up as :: The Young Democrats of Arizona. I have to write in every post title that I share. While I am willing to do this, some bloggers won’t, and it can limit your exposure.

Here is the Textpattern code I wrote for YDAZ using conditional tags to create dynamic titles:

<txp:if_article_list><title> :: The Young Democrats of Arizona </title></txp:if_article_list><txp:if_individual_article> <title> :: The Young Democrats of Arizona – <txp:title /></title></txp:if_individual_article>

This replaces the standard <title> :: The Young Democrats of Arizona </title> on each of your pages. For the blog pages title I used:

<txp:if_article_list><title> :: The Young Democrats of Arizona – Blog</title></txp:if_article_list><txp:if_individual_article> <title> :: The Young Democrats of Arizona – <txp:title /></title></txp:if_individual_article>

By using this code all of your individual posts will have dynamic titles, making social bookmarking a whole lot easier, as well as improving your search engine rankings.

If you have any questions or would like help adding dynamic titles to your Textpattern-based site, leave a comment or contact me.