Building Category homepage showing subcategories with leading articles for each

More
7 years 2 months ago #65679 by micker
in faq template you need
1 master cat (lien menu to)
|_ sub cat1
|_ sub cat2
|_ sub cat3
|_ sub cat4
in master cat assign faq template all level not only 1 subcatégorie

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

Please Log in or Create an account to join the conversation.

More
7 years 2 months ago - 7 years 2 months ago #65680 by netenvie
I found the solution ...

I forgot this line :
$items = & $this->items;

in my template ...

Now i just need to know how to display leadings only ??
Last edit: 7 years 2 months ago by netenvie.

Please Log in or Create an account to join the conversation.

More
7 years 2 months ago - 7 years 2 months ago #65710 by netenvie
Hi all,
Finally i don't need to display leading and whatever i had a solution.
So all is ok except i need to display items from subcats of one subcat in my page ... :/

I have this :

Master cat
|_ sub cat1
|_ sub cat2
|_ sub cat3
|___ sub sub cat1
|___ sub sub cat2

On my page only sub cats 1 and 2 are displayed and i would need to display also items from sub sub cats 1 and 2 ... And mix together.
in other words i need to display items from sub cats of sub cat3 together ...

This is my actual code, what can i add or change to make this run ok ?
Code:
<?php endif; $items = & $this->items; // -- Find all categories used by items $currcatid = $this->category->id; $cat_items[$currcatid] = array(); $sub_cats[$currcatid] = & $this->category; foreach ($this->categories as $subindex => $sub) : $cat_items[$sub->id] = array(); $sub_cats[$sub->id] = & $this->categories[$subindex]; endforeach; // -- Group items into categories for ($i=0; $i<count($items); $i++) : foreach ($items[$i]->cats as $cat) : if (isset($cat_items[$cat->id])) : $cat_items[$cat->id][] = & $items[$i]; endif; endforeach; endfor; foreach ($cat_items as $catid => $items) { $sub = & $sub_cats[$catid]; if ($sub->id == $currcatid) continue; ?> <!-- BOF sub-categories loop --> <h2><a href="index.php?option=com_flexicontent&view=category&Itemid=664&cid=<?php echo $sub->id; ?>"><?php echo $sub->title; ?></a></h2> <h4><?php echo $sub->description; ?></h4> <div class="uk-grid articles"> <?php $ic = 0; foreach ($items as $i => $item) { $ic++; if ($ic>4) continue; ?> <div class="uk-width-1-1 uk-width-small-1-2 uk-width-medium-1-4 epcomexp"> <div> <?php echo $item->fields['photo']->display; ?> </div> <h2><?php echo $item->title; ?></h2> <div class="epartdesc"><?php echo substr($item->text,0,100)." ..."; ?></div> </div> <?php } ?> </div> <?php } ?>
Last edit: 7 years 2 months ago by netenvie.

Please Log in or Create an account to join the conversation.

More
7 years 2 months ago #65725 by netenvie

Please Log in or Create an account to join the conversation.

More
7 years 2 months ago #65726 by micker
sorry ... can't help you for custom code ... but an idea
maybe you can use universal module in different position or in template to achieve this not ?

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

Please Log in or Create an account to join the conversation.

More
7 years 2 months ago - 7 years 2 months ago #65759 by netenvie
Hello,
thanks, the module seems to do the job.
Last edit: 7 years 2 months ago by netenvie.

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.278 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline