
I think I've see the Yahoo javascript/dhtml version of it used on zen-cart:
http://developer.yahoo.com/yui/examples ... klist.html
A good contrib for you to make

FYI, I came across a nice example of what you are talking about. Figured I'd post it here for future reference:JNeuhoff wrote: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.
Code: Select all
if ($result['parent_id'] == 0 && $i == 0) {
$class = 'lvl_0';
// inserted by Fido-X
$margin = $i; // sets margin to 0 at top level
} elseif ($result['parent_id'] == $level[$i]) {
$class = 'lvl_' . ($i+1);
// inserted by Fido-X
$margin = (($i+1) * 15); // increase margin by 15 pixels for each level
}
Code: Select all
$category_data[$result['category_id']] = array(
'name' => $result['name'],
'href' => $url->href('category', false, array('path' => $result['path'])),
'class' => $class,
'margin' => $margin, // inserted by Fido-X
'sort_order' => (int)$result['sort_order'],
);
Code: Select all
<a class="<?php echo $category['class']; ?>" href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
Code: Select all
<a style="margin-left: <?php echo $category['margin']; ?>px;" href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
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!
That can still be done, as long as the padding for each level is the same (ie. leave it up to the margin to determine the amount of indent), eg.:Qphoria wrote: I really was torn on the styling because I was thinking that what if people wanted a different bullet for each level, or different font or something, thats why i made it use a diff style per level.
Code: Select all
<a style="margin-left: <?php echo $category['margin']; ?>px;" class="<?php echo $category['class']; ?>" href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
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!
In admin category, after you add a category, look on the left for the foldermrshabah wrote: how we can add sub categories in the backend??? Am i missing anything?
Here Are Your Options :
1st Option: Web3DesignStudio
More Options ? - What More Do You Need ? !
Here Are Your Options :
1st Option: Web3DesignStudio
More Options ? - What More Do You Need ? !
Users browsing this forum: No registered users and 5 guests