Navigation

About

Named after the Agege district (pronounced ‘a-gay-gay’) in Lagos, Nigeria. Sorry we don’t make the famous Agege Bread in our Labs

Tags

Creating unlimited categories in Textpattern

20 April 2009, 00:00

Textpattern is a powerful content management system which I have been playing with recently. Despite all its great features, Textpattern doesn’t seem to handle categories very well from core installation, for example each post 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 ;)

Step by step guide to adding unlimited categories
Install the rss_unlimited_categories plugin (Updated 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:

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

with this code below

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

In the “default form”, replace the code:

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

with this code below

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

To be able to show catogeries 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 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.

  • Go into your SQL database
  • Browse “txp_pref”
  • Find “rss_unlim_sel_size”
  • Change the “val” of “rss_unlim_sel_size” to 15

All things been 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

AL

Tags: Textpattern, Tips

Comment [4]

---