![]() |
|
Home | Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]() Great post - am looking to do something similar...
However I would like to hide the top level in the list (as this will appear as the widget header) and show all sub categories when the parent is selected - like in the 'normal' category widget... I'm not quite sure how this category.list loop works, so I tried the following in the hope that the outer loop would pick up on the top category, and the second loop would run through the children: Code:
[category.list id=no1] <?php if ($category->id == 544335 || $category->parent == 544335) { ?> [category.list id=no2 before='<ul>' after='</ul>'] [category.if active='self'] <li> <strong><a href="[category.link]" title="[category.name]">[category.name] ([category.count])</strong> [category.repeat id=no2] </li> [/category.if] [category.if active='child'] <li> <a href="[category.link]" title="[category.name]">[category.name] ([category.count])</a> [category.repeat id=no2] </li> [/category.if] [category.if active='parent'] <li> <a href="[category.link]" title="[category.name]">[category.name] ([category.count])</a> </li> [/category.if] [category.if active='no'] <li> <a href="[category.link]" title="[category.name]">[category.name] ([category.count])</a> </li> [/category.if] [/category.list] <?php } ?> [/category.list] Is there an easy way to do this? Thanks!
__________________
WordPress Security - Is your WordPress secure? Get our FREE checklist and find out. Easy-Email - Access ALL your email accounts with one login & synchronize automatically on all your computers. |
#2
|
||||
|
||||
![]() So you just want to show all sub-categories of a parent category but only when the parent category ID has been selected?
__________________
![]() ![]() ![]() ![]() |
#3
|
|||
|
|||
![]() Yes, basically just grab one top level category and show navigation for all sub-categories for this item...
To expand on the example above... Code:
Sports -> Football -> Jerseys -> Shorts -> Mens -> Womens -> Baseball Outdoors -> Tents -> Boats Code:
Widget Title: Sports -> Football -> Jerseys -> Shorts -> Mens -> Womens -> Baseball Thanks!!
__________________
WordPress Security - Is your WordPress secure? Get our FREE checklist and find out. Easy-Email - Access ALL your email accounts with one login & synchronize automatically on all your computers. |
#4
|
||||
|
||||
![]() Question moved to its own thread.
__________________
![]() ![]() ![]() ![]() |
#5
|
||||
|
||||
![]() This will require 2 views to be set up:
Eric
__________________
![]() ![]() ![]() ![]() |
#6
|
|||
|
|||
![]() Brilliant! Works a treat...
Is the [category.if active='self'] supposed to work in this context too? Thanks a bunch for your help!
__________________
WordPress Security - Is your WordPress secure? Get our FREE checklist and find out. Easy-Email - Access ALL your email accounts with one login & synchronize automatically on all your computers. |
#7
|
||||
|
||||
![]() Yes, that will work in there, too. You might need to replace the code with the category list Template 1 code.
__________________
![]() ![]() ![]() ![]() |
#8
|
|||
|
|||
![]() Works fine - apart from expanding child categories for the selected item...
At the moment I have the stock standard template 1 code, and still no luck... My shop id is 30208... Any other ideas as to what I might try? Thanks!
__________________
WordPress Security - Is your WordPress secure? Get our FREE checklist and find out. Easy-Email - Access ALL your email accounts with one login & synchronize automatically on all your computers. |
#9
|
||||
|
||||
![]() I don't know... what are you trying to accomplish?
__________________
![]() ![]() ![]() ![]() |
#10
|
|||
|
|||
![]() Sorry, I am not being very clear :-)
From: Code:
-> Football -> Jerseys -> Shorts -> Mens -> Womens -> Baseball Code:
-> Jerseys -> Shorts
__________________
WordPress Security - Is your WordPress secure? Get our FREE checklist and find out. Easy-Email - Access ALL your email accounts with one login & synchronize automatically on all your computers. |
#11
|
||||
|
||||
![]() What's your store's ID and view name?
__________________
![]() ![]() ![]() ![]() |
#12
|
|||
|
|||
![]() Store ID 30208
View names "Category - Lunette de soleil" and "onlysubcats"
__________________
WordPress Security - Is your WordPress secure? Get our FREE checklist and find out. Easy-Email - Access ALL your email accounts with one login & synchronize automatically on all your computers. |
#13
|
||||
|
||||
![]() I updated your view. See if that works. If it does, I will tell you what I did.
__________________
![]() ![]() ![]() ![]() |
#14
|
|||
|
|||
![]() It expands all sub categories even if they are not selected...
__________________
WordPress Security - Is your WordPress secure? Get our FREE checklist and find out. Easy-Email - Access ALL your email accounts with one login & synchronize automatically on all your computers. |
#15
|
||||
|
||||
![]() Oops, sorry, try again.
__________________
![]() ![]() ![]() ![]() |
#16
|
|||
|
|||
![]() same same...
__________________
WordPress Security - Is your WordPress secure? Get our FREE checklist and find out. Easy-Email - Access ALL your email accounts with one login & synchronize automatically on all your computers. |
#17
|
||||
|
||||
![]() I don't think we can get it to work as we are setting the "active" category here: [DFR:onlysubcats?c=517926]
That basically says, "When generating this category menu, treat category ID 517926 as the active category at all times".
__________________
![]() ![]() ![]() ![]() |
#18
|
|||
|
|||
![]() Okay, no problem...
I suspect there is no easy way to check upwards in the tree to see if a parent has a given id? I tinkered with a condition of this nature: Code:
[category.list before='<ul>' after='</ul>'] <?php $pos = strpos($category->name,"xxxx"); if ($pos != false) { ?> .... Anyways, not to worry... Thanks for trying!
__________________
WordPress Security - Is your WordPress secure? Get our FREE checklist and find out. Easy-Email - Access ALL your email accounts with one login & synchronize automatically on all your computers. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
v1 to v3 Modules Utilizing Attributes, Click/PV Popularity, Specific Categories | cspdfadmin | Upgrading from V1 to V3 | 1 | January 23rd, 2011 11:10 AM |