I've been working on getting the subcategories to list in the Category box.
DEMO. Click on categories on left to expand them
It is set to show the subcategories in between the main categories, recursively down multiple levels.
It will also keep the proper hierarchy open while viewing the products, and hide the ones that don't belong to the category.
It also works based on CSS. I added a "cats" class for the main category and a "subcats_lvl_#" for each lower level.
It works pretty well, but I am currently using one query for each level down. So if are showing Cat 1 -> Sub Cat 1->Sub Sub Cat 1 is uses 3 db queries. I've almost finish redesigning it to use 1 query to make it simpler and more or less improve performance (not that it will be really noticeable).
Keep an eye here for the release in the next day or two.
Q!
Fido-X.
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool
If you're not living on the edge ... you're taking up too much space!
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
It looks as tho this one displays all categories at all times... I managed to get that working as well without so many changes. But mine works on a per main category basis, so you only see the related categories, not all at once. Diff Strokes/Diff Folksfido-x wrote: Most of this has already been covered here http://forum.opencart.com/index.php/top ... ml#msg3318.
Fido-X.
Is that using the categories extension? or a new one for a top menu?JNeuhoff wrote: As regards sub-categories: We are using a purely CSS-based solution from ADX Menu
Thx
I should also mention that mine will support (but not require) my drop-in override code, so there will be no files to manually edit, just drop into an override folder and it will default to that version of the code and circumvent the core.
No, although it could support it, too.Is that using the categories extension? or a new one for a top menu?
I just changed some templates for the header in the files:
/catalog/template//module/header.tpl and
/catalog/template//layout.tpl and of course the
/catalog/template//css/default.css
The header.tpl now calls a newly created viewer helper class with a function which gets all categories from the database and returns a generated nested HTML UL and LI elements for each category. The CSS file uses a 3rd party dropdown menu system from http://aplus.rs/adxmenu/
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
Isn't that what yours does? I visited your demo site, and what I saw (without clicking anything) was Category 1 fully expanded.It looks as tho this one displays all categories at all times...
Fido-X.
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool
If you're not living on the edge ... you're taking up too much space!
I've changed the demo to show the default index to be less confusing.
I think it is still work in progress.Isn't that what yours does? I visited your demo site, and what I saw (without clicking anything) was Category 1 fully expanded.
What should be added is this (I am now thinking in terms of category tree nodes):
When you click on a (possibly nested) category, it should toggle its tree expansion state, and it should only affect its own sub-tree branch.
No other category tree branches should be expanded, except for the currently active category tree node where the branch is open up to its top-level parent tree node.
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
um, isn't that what it does? (aside for the bug with the 1A sub lining up under 1B sub)JNeuhoff wrote:I think it is still work in progress.Isn't that what yours does? I visited your demo site, and what I saw (without clicking anything) was Category 1 fully expanded.
What should be added is this (I am now thinking in terms of category tree nodes):
When you click on a (possibly nested) category, it should toggle its tree expansion state, and it should only affect its own sub-tree branch.
No other category tree branches should be expanded, except for the currently active category tree node where the branch is open up to its top-level parent tree node.
I mean
Start at main index. You see 3 Main cats (Main1, Main2, Main3)
Click Main1 you see the 3 main cats, and the 2 subs under Main1 only: Sub Cat 1A, Sub Cat 1B
Click Sub Cat 1A and you see 3 Main cats, 2 subs under Main1, and the sub under Sub Cat 1A (except it shows up under 1B, but that is a display bug that I have fixed in the 1 db query version).
Now Click Main2, and all of Main1's subs hide.
- 1 Query!
- Dynamic levels!
- tiny tpl change (to add $class variable)
- ~12 lines of code to the category module
- Override system compatible!
- CSS design base!
- No display level bugs
- Works with & without URL Aliasing enabled
Click For Demo
I thought about adding an admin option to enable/disable the view (no subs, relevant subs, or all subs) but that can come later.
Released: DOWNLOAD | DEMO
Let me know if you have any problems.
-EDIT-
Didn't realize *.rtf wasn't supported on Mac, so I here is a pdf version of the readme file if needed:
http://www.unbannable.com/DRS_Readme.zip
A cinch to install and initial testing shows this to work exactly as described. Lots of scope for styling this via CSS.Qphoria wrote: Released: DOWNLOAD
Hats off to you Qphoria
Chris
Chris @ SiteE@se Web Design
It's nearly there. When I mean is this:um, isn't that what it does? (aside for the bug with the 1A sub lining up under 1B sub)
Initially, your demo list all the top-level category. When I click on one of them, it expands to a sub-tree. Now, if I click again on the same top-level category, I would have expected it to close the sub-tree, which it doesn't. The sub-tree stays open.
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
Like:
Cat 1
Cat 2
Cat 3
*Click Cat 1*
Cat 1
- Cat1sub1
- Cat1sub2
Cat2
Cat3
*Click Cat 1 again*
Cat 1
Cat 2
Cat 3
Like that? I think that works for something like the sidebar in Windows XP when you want to show details like this WinXP Navigational menu(left side). Maybe not so much for a product menu. Maybe something fancy for a contrib with javascript and dhtml and what not. My design is meant more for a simple core design, something that OpenCart could (and probably should) have by default.
Ah that's right. I am sorting by "cpath" instead of "sort_order". I meant to change that back but it was giving me some grief.Luvz2drv wrote: it does not respect sort order either from my testing.
I will look at that.
Thx for the heads up
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool
If you're not living on the edge ... you're taking up too much space!
Yes, like that. As an example, seeQphoria wrote: You mean to toggle open and close?
Like:
Cat 1
Cat 2
Cat 3
*Click Cat 1*
Cat 1
- Cat1sub1
- Cat1sub2
Cat2
Cat3
*Click Cat 1 again*
Cat 1
Cat 2
Cat 3
Like that?
http://www.histpop.org/ohpr/servlet/Bro ... active=yes
While it is not OpenCart (in fact it's a Java servlet) it illustrates the toggling mechanism of sub-trees.
Its behavior is similar to what the user knows from Windows or Linux file explorers.
The toggling of sub-trees should only be triggered by clicking on the icon
(which could be a plus or minus icon, or of a small tri-angular shape).
The content pane should only be re-freshed after clicking on the category name link.
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
Users browsing this forum: No registered users and 16 guests