[TYPO3-ttnews] Items with selected (sub)categories are not visible in FE

Ben van Kruistum ben at wulf.nl
Mon Dec 15 17:59:46 CET 2008


Hello List,

At the moment I am facing some difficulties showing news items based on 
specific categories.  If I want to show a list on a page I instert the news 
plugin as a content element. In there I select (besides offcourse the needed 
options) the categories en choose for the category mode "Show items with 
selected categories (AND)" and set the "Use subcategories" to "Yes"

If I preview the FE it is not showing my news items.

I use the following case as an example:

The categories:
Cars
    Fiat
    Subaru
    Mercedes

News
    Scoop
    Sport
    Government


I configure the plugin to show a list with the following categories selected 
: "News" and "Subaru"
Besides that I have got a news item that has the following categories 
selected, "Subaru","News","Scoop"

The item is not showing. Is this just as expected? I thought it should be 
visible cause the news item corresponds the the selected categories taking 
in account the option "Use subcategories"

The plugin "says" get all news items that are in the category News And 
Subaru. My added news item should be matched cause it is in News and in 
Subaru.

After digging into the code I found the following, what solved my problem 
but I do not know exactly if by changing this something else is falling 
down.

around line 1331(pi/class.tx_ttnews.php) in the function getSelectConf there 
is the piece of code that takes care of the categoryMode "show items AND" 
(the one I selected in the plugin).
the Variable $tmpCatExclusive is assigned with $this->catExclusive. This 
value contains all selected categories and its subcategories. And it 
evaluates if the found news item has the same amount and corresponding 
categories. In my case the code acts like, does this news item has News, 
Scoop, Sport, Government and Subaru selected.

This is the reason why the news item is not shown while , in my perspective 
, it should have.

There is (after where $tmpCatExclusive  is set) a piece of commented code 
that solves my problem. If I asssign $this->actuallySelectedCategories 
instead of  then it works like a charm. But I do not know if this is causing 
something else to brake down.


With kind regards,

Ben.
 



More information about the TYPO3-project-tt-news mailing list