Yes, I'm still at it...and am feeling stupid with this Smarty code.
I added this code to home.tpl Code:
{if $smarty.get.cat eq "248"} The file "menu_blah.tpl" is the custom menu I want to show in all the pages of a certain category. The problem is that menu only shows on one page, not the rest of it's category. I'm sure the code I need to change is : {$smarty.get.cat eq "248"}, but to what? I'm still trying to control the order of the menu being shown at any given time. Like the control freak I am... :roll: Thanks in advance... |
I'm not sure what's in $smarty.get.cat. Would it be the current category that you're browsing?
In my code, I figure out what the (topmost) category we're browsing is by: Code:
{assign var=current_category_top value=$current_category.categoryid_path|regex_replace:"/\/.*/":""} So that variable current_category_top will hold the topmost category in the current category tree. So if you're browsing Food :: Chinese :: Noodles :: Very thin ACME noodles current_category_top will report "Food". Would this do the trick for you? This is all trial and error... but I'd suggest you'd try this: Code:
{assign var=current_category_top value=$current_category.categoryid_path|regex_replace:"/\/.*/":""} |
Fernando, you're a genius. That worked perfectly. It's a bit manual, but it's really only me that makes changes to this sort of thing, so that's okay.
Brilliant! I can move onto all the other annoying details... Have a good one! |
Amazing how I can't ever get it right the first time around when I work for my own store! Haha!
Glad I could be of help. |
Quote:
Been messing with categories.php, and I have manged to get the sub-cats to be nicely ordered by position in the admin area, but no such luck on the customer side. Here's what I have in categories.php: Code:
if ($flag == "all") Any other place I should be adding an order_by??? Thanks in advance! |
I commented out
Code:
usort($all_categories, "func_categories_sort"); |
Beautiful, thanks! :D
|
I'm trying to implement the code from zilker (thanks, btw :D), and till now I manage to display the categories horizontal in the head and to show the subcategories in the left menu, when a categorie is clicked.
So far so good... But after clicking on a subcategorie the whole box with subcategories disappears. Like zilker I would like the box with subcategories to stay visible so a customer can choose another subcategorie without having to click again on the categorie. I've tried to use the code provided by shan, but without any luck... :cry: Could someone please be so kind to show how to do this? Many thanks in advance! |
show sub categories only when main category is selected
This mod works great in 4.0.13 by combining heads Fernando and Gabriela provide X-er's with code that will list sub categories under the main category
Example: MAIN NAV 1 MAIN NAV 2 sub nav 1 sub nav 2 sub nav 3 sub nav 4 MAIN NAV 3 MAIN NAV 4 Just add Fernando's code to customer/main/subcategories.tpl and to ensure categories maintain their 'order by' status take Gabriela's advice editing out 'usort' item within the includes/categories.php. One other thing I hadn't found mentioned here... you must have "Always show Root Categories' checked in the admin section under general settings. Thanks. |
I've got it also working, but I'm looking for a solution to display all levels
of subcategories. Not in a permanent way but only when a first level subcategorie is clicked. The link below shows roughly what I'm looking for. http://www.udm4.com/demos/expanding-multiple.php |
All times are GMT -8. The time now is 12:36 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.