![]() |
|
Home | Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]() Hi Eric,
I am sure this is totally easy, but the function to do it in V3, just doesn't seem to be there. I am converting another store over to V3. Currently this store has 5 parent categories: http://factory3.datafeedr.com/feeder/shop?shop=6202 However on the live website, I want to put the category widget in the side bar, but I want it to display only the sub categories, from one of the parent categories. This was achieved easily in V1 by just selecting that sub category from the category widget, but this doesn't seem to be possible in V3. And from within the factory, I would have thought I could put a custom query string in, to just display that category, but it isn't available on the Category List module. Ok, so tell me I am crazy and this is easy to achieve, but I am just missing something here? |
#2
|
||||
|
||||
![]() Yes, this is possible.
__________________
![]() ![]() ![]() ![]() |
#3
|
|||
|
|||
![]() Right, that looks much more complicated than the previous way we did it... but that is the price we pay for being able to customize V3 so much!... and that is a good thing.
Thanks for the tip. Not that I had tried it yet, but I was going to add a PHP text box widget in Wordpress and do this: <?php echo datafeedr_tag("widget/categories?c=314811"); ?> Would that also have worked? |
#4
|
||||
|
||||
![]() Yes, there is an inverse relationship between simplicity and customizability.
Yes, you can replace any DFR shortcode with the datafeedr_tag() function. So in my example above, you could have also done this: <?php echo datafeedr_tag("subcats?c=123456"); ?>
__________________
![]() ![]() ![]() ![]() |
#5
|
|||
|
|||
![]() Hi Eric,
I have successful upgraded the store and this feature above worked fine. Just a small issue I would like to fix. When you are on a certain category, I would like that category to be highlighted, or not hyperlinked as it normally is. You said above to use this: PHP Code:
PHP Code:
Why does this same code from the normal Category Widget not work? Any suggestions on how to get it to work? |
#6
|
||||
|
||||
![]() That's a limitation of this method because the way it is, the targeted parent category is always 'active'.
__________________
![]() ![]() ![]() ![]() |
#7
|
|||
|
|||
![]() Eric, It is not good enough. It was a function that was available in V1 and now suddenly it is not available in V3, even though V3 is meant to be more customizable. We need to find a solution to this.
I have tried a few different ways to get the category widget to display, but can't solve the issue of it not highlighting the active category. One solution, that would suffice for me for the moment, until we find a better solution, is to just have my full tree displayed on every page. I can not however get this to work. On the Category widget in the Factory, I have the options set to FULL TREE and have 3 written in as the tree depth, however when I add the Datafeedr category widget to the sidebar, it only shows the parent categories. When I click on the sub category, it shows the child categories. However I want it to display the FULL tree from the start. Why does it not do this? For this store, I have 5 parent categories, but only one of them has sub categories. It was that one that I wanted to only show in the sidebar navigation. However I don't like it not having active category different in some way. So I will put the full 5 categories in the navigation, if you can show me how to have it display all the sub categories too. |
#8
|
|||
|
|||
![]() Ok, I have managed to get the following code to work:
PHP Code:
I tried a few things and couldn't get it to work. I am guessing I need some sort of statement in there which is [category.if active="self"] AND [category.if active="parent"], but I don't know how to do that. Any ideas? Also, what exactly does the PHP Code:
|
#9
|
||||
|
||||
![]() Hi
Try this (be sure to replace 123456 with your parent category ID: HTML Code:
<?php $catids = array(); ?> [category.list before='<ul>' after='</ul>'] <?php global $catids; if ($category->id == 123456 || in_array($category->parent, $catids)) { $catids[] = $category->id; ?> [category.if active="self"] <li class="active"> [category.name] [category.repeat] </li> [/category.if] [category.if active="child"] <li> <a href="[category.link]" title="[category.name]">[category.name]</a> [category.repeat] </li> [/category.if] [category.if active="parent"] <li> <a href="[category.link]" title="[category.name]">[category.name]</a> </li> [/category.if] [category.if active="no"] <li> <a href="[category.link]" title="[category.name]">[category.name]</a> </li> [/category.if] <?php } ?> [/category.list] Quote:
__________________
![]() ![]() ![]() ![]() |
#10
|
||||
|
||||
![]() Quick note, you don't have to set up 2 views for my previous code to work. Just create a new Widget view, add a category list module and then add that code.
__________________
![]() ![]() ![]() ![]() |
#11
|
|||
|
|||
![]() Quote:
Last edited by stefan : March 6th, 2011 at 06:26 PM. |
#12
|
|||
|
|||
![]() Stefan and Eric,
Sorry I forgot to mention above that I had actually put the code, straight into the standard Categories Widget. I was no longer using custom view, or a custom view widget. However, that code above didn't work. It produced this error: PHP Code:
PHP Code:
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
'Home' in the category widget | lbuilta59 | Questions | 1 | February 5th, 2011 12:57 PM |