Hello, thx for your help. I'll try in english.
Currently, this faq template doesn't serve my needs.
this template show only sub cats.
What I want is to show all the cats (not only subcats) the items is linked with.
I've a lot of categories at the same level, and sometimes subcategories.
When I write an article, I'll link it with one, two or more categories, sometimes with subcategories.
With this code (maybe there's a better way to code it),
Code:
if ($this->items) :
$currcatid = $this->category->id;
$cat_items[$currcatid] = array();
$sub_cats[$currcatid] = & $this->category;
$items = & $this->items;
for ($i=0; $i<count($items); $i++) :
foreach ($items[$i]->cats as $relatcats => $sub) :
$cat_items[$sub->id] = array();
$sub_cats[$sub->id] = & $items[$i]->cats[$relatcats];
endforeach;
foreach ($items[$i]->cats as $cat) :
if (isset($cat_items[$cat->id])) :
$cat_items[$cat->id][] = & $items[$i];
endif;
endforeach;
endfor;
I achieved to show all the categories the article is link with, but actually, it show only the first article, not the others. Sometime, the same article is shown 2 or 3 times, because he's linked with 2 or 3 categories.
So I've got :
categorie 1
--- article A
categorie 2
-- article B
categorie 3
-- article A
-- and if there is an other article linked with this categorie, I want it there.. for exemple article C. Actually, there just the first article.
If you try it on your faq template, you might show the same result.
Now, I'm trying to find the way to display under the categorie all the items linked with "$currcatid" and $relatcats.
I hope you've understood my needs and I apologize for my english. Thanks for the help.