Creating unlimited categories

Despite all its great features, Textpattern doesn’t seem to handle categories very well in a core installation, for example each article can only be assigned two categories.

After spending considerable time in the textpattern forum, I finally figured out how to create unlimited categories in Textpattern. I have put together the guide to prevent heartache for other newbies like me ;)

Please note that the guide is based on a default Textpattern installation.

Step by step guide to adding unlimited categories

  1. Install the rss_unlimited_categories plugin and enable it. The plugin should automatically create a new sql table called textpattern_category.

Create a new section called category and use the default page template

In the default page, replace the code:

<h2><txp:category title="1" /></h2>
<div class="hfeed">
<txp:article form="article_listing" limit="5" />

With this code:

<h2>Category: "<txp:category title="1" />" </h2>
<div class="hfeed">
<txp:rss_uc_article_list section="articles"
form="default" />

In the default form, replace the code:

<p class="tags">
<txp:category1 title="1" link="1" />,
<txp:category2 title="1" link="1" />

With this code:

<p class="tags">Tags:
<txp:rss_uc_filedunder section="articles"
linktosection="category" />

To be able to show categories in the sidebar, some modification is also required. Simply replace the code below:

<txp:category_list sort="name asc"
type="article" wraptag="ul" break="li"/>

With this code:

<txp:rss_uc_list linktosection="category"
showcount="1" wraptag="ul"
break="li" class="category_list" />

Other tweaks

It may also be useful to hide the old category form, use the ied_hide_in_admin plugin to do this.

Enlarging the the text area for the new category form can be done in SQL. I only recommend this if you are comfortable with SQL.

  1. Go into your SQL database
  2. Browse “txp_pref”
  3. Find “rss_unlim_sel_size”
  4. Change the “val” of “rss_unlim_sel_size” to 15

All things being equal, that’s all you need to do!

Useful links

Getting Started with Textpattern (here you can find the default page and form templates)
rss_unlimited_categories Support forum

comments powered by Disqus