Rego’s Everyday Life

A blog about my work at Igalia.

gl_pages_cat: Pages categorization in TYPO3

gl_pages_cat is a TYPO3 extension that allows to relate TYPO3 pages with categories from tt_news_cat table. In that way, you’ll only have a category tree common for the whole website, pages and news are going to share the same categories. At the beginning this extension just provided a method that returns the news related with the categories of the current page. It was enough for me, because of I was doing news lists from Formidable.

But now, it also provides a new method that returns the categories of the current page. With this method, for example, you can assign some categories to a page and, then, configure properly tt_news plugins to show only news related with the categories of that page. You could do something like that with the next TypoScript code:

includeLibs.user_pages_cat = EXT:gl_pages_cat/class.tx_glpagescat_div.php

lib.page.category = USER
lib.page.category.preUserFunc = tx_glpagescat_div->getPageCategories

plugin.tt_news.categorySelection < lib.page.category
plugin.tt_news.categoryMode = 1

I’m very grateful to Daniel Huf for having tested my extension and having given me his feedback (this TypoScript configuration). Thanks to this, the extension has improved and, from my point of view, now it’s very useful combined with tt_news plugins.

For example, if you have a categorized TYPO3 website, once you have everything configured properly, you could change the news displayed on a page simply by changing the categories of the page.


Comments

On 09/02/11 13:27, **[Daniel](http://www.cross-agency.ch/)** wrote:

Thanks a lot for your work and help.

On 10/03/27 23:29, Jacob Seiner wrote:

Hi, I installed gl_pages_cat and noticed that the category tree was not showing in the flexform.

I am using tt_news version 3.0.1 and to make the category tree show up when editing page properties, I changed one line in the ext_tables.php file of the gl_pages_cat extension.

I changed the following line:

‘userFunc’ => ‘tx_ttnews_treeview->displayCategoryTree’,

to:

‘userFunc’ => ‘tx_ttnews_TCAform_selectTree->renderCategoryFields’,

After doing that, the category tree showed up in the page flexforms and I was able to associate tt_news categories to my regular pages.

I’m looking forward to playing around more with your gl_pages_cat extension.

On 10/07/28 09:44, Manuel Rego Casasnovas wrote:

I’ve just fixed the issue with tt_news 3.0.1. And released a new version 0.1.5 that will be available soon at TER.

Thanks for reporting.