Category-Subcategory-Article

More
14 years 2 weeks ago #6145 by Fidelix
Hello.

I would like to achieve this layout in Category View:



I have read lots of threads but have not found an definite answer if it is possible or not.

Is it possible?

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

More
14 years 1 week ago #6508 by flowman
Im working on just that typ of template right now. Its not that hard to implement.

If you change the original com_flexicontent/model/category.php
Code:
function getChilds() { $query = $this->_buildChildsquery(); $this->_childs = $this->_getList($query); // $this->_childs = $this->_getList($query, $this->getState('limitstart'), $this->getState('limit')); $k = 0; $count = count($this->_childs); for($i = 0; $i < $count; $i++) { $category =& $this->_childs[$i]; $category->assigneditems = $this->_getassigned( $category->id ); $category->subcats = $this->_getsubs( $category->id ); $k = 1 - $k; } return $this->_childs; }
to
Code:
function getChilds() { $query = $this->_buildChildsquery(); $this->_childs = $this->_getList($query); // $this->_childs = $this->_getList($query, $this->getState('limitstart'), $this->getState('limit')); $id = $this->id; $this->_data = null; $k = 0; $count = count($this->_childs); for($i = 0; $i < $count; $i++) { $category =& $this->_childs[$i]; $category->assigneditems = $this->_getassigned( $category->id ); $category->subcats = $this->_getsubs( $category->id ); $this->_id = $category->id; $category->items = $this->getData(); $this->_data = null; $k = 1 - $k; } $this->_id = $id; return $this->_childs; }
This code change will add the items to the categories variable for each subcategory.

And then in your subcategory template add something like this.
Code:
<?php foreach ($sub->items as $item) : ?> [url=<?php echo JRoute::_( FlexicontentHelperRoute::getItemRoute($item->slug) ); ?>]<?php echo $this->escape($item->title); ?>[/url] <?php endforeach; ?>

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.578 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