Directory View showing items

More
14 years 8 months ago #4292 by KingoftheRoad
I repost this as a new topic because no one responsed me in my previous post( www.flexicontent.org/forum/index ... t=10#p4167 ).

I want to modify the directory view to show the subitems of subcategories, instead of subsubcategories.

The file to be modified is at /components/com_flexicontent/views/flexicontent/tmpl/default_categories.php.

Original:
Code:
<div class="column"<?php echo $style; ?>> <?php foreach ($this->categories as $sub) : ?> <div class="floattext"> <h2 class="flexicontent cat<?php echo $sub->id; ?>"> <a href="<?php echo JRoute::_( FlexicontentHelperRoute::getCategoryRoute($sub->slug) ); ?>"> <?php echo $this->escape($sub->title); ?> <?php if ($this->params->get('showassignated')) : ?> <span class="small"><?php echo $sub->assigneditems != null ? '('.$sub->assigneditems.')' : '(0)'; ?></span> <?php endif; ?> </h2> <ul class="catdets cat<?php echo $sub->id; ?>"> <?php foreach ($sub->subcats as $subcat) :?> <li> [url=<?php echo JRoute::_( FlexicontentHelperRoute::getCategoryRoute($subcat->slug) ); ?>]<?php echo $this->escape($subcat->title); ?>[/url] <?php if ($this->params->get('showassignated')) : ?> <span class="small"><?php echo $subcat->assignedsubitems != null ? '('.$subcat->assignedsubitems.'/'.$subcat->assignedcats.')' : '(0/'.$subcat->assignedcats.')'; ?></span> <?php endif; ?> </li> <?php endforeach; ?> </ul> </div> <?php $i++; if ($i == $condition1 || $i == $condition2 || $i == $condition3) : echo '</div><div class="column"'.$style.'>'; endif; endforeach; ?> </div>

My Modification:
Code:
<div class="column"<?php echo $style; ?>> <?php foreach ($this->categories as $sub) : ?> <div class="floattext"> <h2 class="flexicontent cat<?php echo $sub->id; ?>"> <a href="<?php echo JRoute::_( FlexicontentHelperRoute::getCategoryRoute($sub->slug) ); ?>"> <?php echo $this->escape($sub->title); ?> <?php if ($this->params->get('showassignated')) : ?> <span class="small"><?php echo $sub->assigneditems != null ? '('.$sub->assigneditems.')' : '(0)'; ?></span> <?php endif; ?> </h2> <ul class="catdets cat<?php echo $sub->id; ?>"> <?php foreach ($sub->subcats as $subcat) :?> <li> [url=<?php echo JRoute::_( FlexicontentHelperRoute::getCategoryRoute($subcat->slug) ); ?>]<?php echo $this->escape($subcat->title); ?>[/url] <?php if ($this->params->get('showassignated')) : ?> <span class="small"><?php echo $subcat->assignedsubitems != null ? '('.$subcat->assignedsubitems.'/'.$subcat->assignedcats.')' : '(0/'.$subcat->assignedcats.')'; ?></span> <?php endif; ?> </li> <?php endforeach; ?> </ul> <ul class="catdets cat<?php echo $sub->id; ?>"> <?php foreach ($sub->items as $item) :?> <li> [url=<?php echo JRoute::_( FlexicontentHelperRoute::getItemRoute($item->slug, $sub->slug) ); ?>]<?php echo $this->escape($item->title); ?>[/url] </li> <?php endforeach; ?> </ul> </div> </div> </div> </div> </div> <?php $i++; if ($i == $condition1 || $i == $condition2 || $i == $condition3) : echo '</div><div class="column"'.$style.'>'; endif; endforeach; ?> </div> <div class="clear"></div>

The problem is: it doesn't work. :roll:
Obviously the problem is the change from
Code:
<?php foreach ($sub->subcats as $subcat) :?> <li> [url=<?php echo JRoute::_( FlexicontentHelperRoute::getCategoryRoute($subcat->slug) ); ?>]<?php echo $this->escape($subcat->title); ?>[/url] <?php if ($this->params->get('showassignated')) : ?> <span class="small"><?php echo $subcat->assignedsubitems != null ? '('.$subcat->assignedsubitems.'/'.$subcat->assignedcats.')' : '(0/'.$subcat->assignedcats.')'; ?></span> <?php endif; ?> </li> <?php endforeach; ?>
to
Code:
<?php foreach ($sub->items as $item) :?> <li> [url=<?php echo JRoute::_( FlexicontentHelperRoute::getItemRoute($item->slug, $sub->slug) ); ?>]<?php echo $this->escape($item->title); ?>[/url] </li> <?php endforeach; ?>
But I don't know what's wrong :(

Anybody could tell me what's wrong with it?

Many thanks.

Seth

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

More
14 years 7 months ago #6044 by flummi84
same problem!
did u find a solution?

greetings

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

More
13 years 8 months ago #14193 by nniiccoollee
I had a similar request and was able to get the view I wanted by making the parent category the primary category and the subcategory secondary.

Example category structure: Multimedia / Podcasts
My item's primary category was multimedia and its secondary category was podcasts. Items did display when clicking the Multimedia category link and also when clicking the podcasts subcategory link.

Hope this helps,
Nicole

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

More
13 years 8 months ago #14304 by flummi84
I still cant get it to work. There are some threads on this topic but no good 'How To'.

Hope someone can finally help me:

Category View with items:

(shows all items)

Directory View:

(shows no items)

This is what i want:

(Category View with related subcategory items in subcategory list)

I would really appreciate some help on this topic!

Thanks

greetings

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

More
13 years 8 months ago #14557 by flummi84
hello,

i dont know if the solution is not worth explaining or too difficult..

anyway its a little frustrating to get no response in this forum. a supporting community would make things easier ;)

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

More
12 years 11 months ago #21253 by ggppdk
Replied by ggppdk on topic Directory View showing items
In v1.5.6 RC2, we have a new template called 'faq' that can serve for this purpose with a lot of options !!!

But remember you must display ALL items of category to work this properly !!! so set a big limit to the items "per page" in category parameter.


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

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

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