Customizing Category Menu |
Post Reply |
Author | |
wsiwpg
Newbie Joined: 14-January-2008 Status: Offline Points: 0 |
Post Options
Thanks(0)
Posted: 12-March-2008 at 6:02pm |
Hello,
We've recently lost our programmer, and as the remaining developer, I am trying to find out how I would approach the customization of the tree menu navigation for product categories. First, of course, I find the +/- useless to our needs. However, since I'm no programmer, and minimally experienced in the javascript and asp side of things, I'm not sure what code I do and do not touch to remove it from the category list. Secondly, I would like to have control over the sizing/styling of categories and subcategories. If I could have the font size smaller on subcategories, etc, that would greatly improve the look and usability of the store. Last, and I am not convinced on this, I would like to have the option for all categories and subcategories to show without having to expand or contract. However, I'm not positive that it will be the best option in the end, so also being able to nicely style the menu WITH the expand/collapse feature is also important. I know these changes can be made, but like I said, I haven't played with the tree menu before, so any tips on where to start would be much appreciated! Thank you! |
|
Greg Dinger
Certified ProductCart Developers Joined: 23-September-2006 Location: United States Status: Offline Points: 238 |
Post Options
Thanks(0)
|
The tool that generates the category navigation can be a bit tricky to alter. I have done so a few times and keep refining the results.
With http://www.pestdetour.com, I simply needed to get the classes assigned so that the horizontal divider would seperate the categories but not the subcategories. http://www.wranglersroost.com/store/pc (not yet launched) required a bit more finessing. To accomplish this the category navigation was altered to assign different CSS classes to categories versus subcategories. http://www.home-distilling.com/home.asp (also not launched but very close) features a subcategory listing that is open at the beginning. This required dual CSS class assignment as performed for Wranglers, but also involved a slight adjustment to the JS. So while my post probably doesn't help in terms of coaching you as to how to achieve your required changes, I do try to point out that such changes are possible albeit not without a bit of effort. |
|
wsiwpg
Newbie Joined: 14-January-2008 Status: Offline Points: 0 |
Post Options
Thanks(0)
|
Well thank you for your reply! I do see now the possibilities that arrive when customizing the navigation, however, since I've still no idea where to start, might you be able to point me in the right direction? For example, to add your classes to the categories and subcategories, what file did you edit?
|
|
Greg Dinger
Certified ProductCart Developers Joined: 23-September-2006 Location: United States Status: Offline Points: 238 |
Post Options
Thanks(0)
|
pcadmin/genCatNavigation.asp Be sure to have a backup of the page if you begin to edit it.
|
|
Hamish
Admin Group Joined: 12-October-2006 Location: United Kingdom Status: Offline Points: 56 |
Post Options
Thanks(0)
|
Hi,
There are lots of options open to you. Personally I'm quite a fan of the dynamic navigation menus available from the support centre : http://www.earlyimpact.com/productcart/support/developers.as p Mainly because we don't have to re-generate the navigation menus when updating a site. Styling is achieved with CSS and there are various options available. If none of these suits your needs I recommend engaging someone to assist you (perhaps Greg ?? ) |
|
wsiwpg
Newbie Joined: 14-January-2008 Status: Offline Points: 0 |
Post Options
Thanks(0)
|
- Hamish,
Thank you for the tip! The code snippet for displaying all categories expanded is very close to what I was looking for. On one last note, is there a way to alter the code to show only the first two levels of categories? (Ie: category and only the first level subcategory) Thank you to everyone else for your input! I will be sure to keep all your help and options in mind. :) |
|
Hamish
Admin Group Joined: 12-October-2006 Location: United Kingdom Status: Offline Points: 56 |
Post Options
Thanks(0)
|
Hi,
I assume you mean display_cat_subcat.zip - file viewCategories4.asp Please note - I haven't tested the changes below ! To remove the additional subcategories remove from Line 40 : <% myCatStr="SELECT idCategory, categoryDesc FROM categories WHERE idparentcategory="& var_idCategory2 to lines 74-75 : <% rsCatObj3.moveNext loop %></td> - leaving behind a </td> HTH |
|
wsiwpg
Newbie Joined: 14-January-2008 Status: Offline Points: 0 |
Post Options
Thanks(0)
|
It worked, thank you! I've had one change request from our client, and I do need to know further information on how possible it is. Sorry to have to rely so heavily on everyone's help, but at least it's a learning experience for the future!
If I were to use the Show Categories & Subcategories snippet from the developer's corner, (display_cat_subcat.zip - file viewCategories4.asp) is there a way for us to remove specific category/subcategory sections from the dynamic menu and hard code them elsewhere on the page, but still have the original menu be dynamic? To make things clearer, our client is running a music store. They want the music categories listed on the left hand side, and the equipment on the right hand side. As the equipment will never change, the client doesn't mind if that is hard coded into the layout, however, since the music categories will be constantly changing, the client would like for the left hand side to be dynamic, so they may create those changes themselves. |
|
Hamish
Admin Group Joined: 12-October-2006 Location: United Kingdom Status: Offline Points: 56 |
Post Options
Thanks(0)
|
I've done this to remove a single category before but you can easily extend the method :-
This is customisation of the ASP code - so keep documentation of what you have done and a copy of the original file. Because this is an additional piece of code rather that part of the base product you are fairly safe from updates over-writing your customisations, but it's best to be safe and also best practice. Anyway - Look for the lines in the format :- <myCatStr="SELECT idCategory, categoryDesc FROM categories WHERE idcategory > 1 AND idparentCategory=1 ORDER BY priority, categoryDesc ASC" You can add additional conditions to prevent certain categories being displayed. e.g. to remove category 4 amend it to read : <myCatStr="SELECT idCategory, categoryDesc FROM categories WHERE idcategory > 1 AND idCategory<>4 AND idparentCategory=1 ORDER BY priority, categoryDesc ASC" The code in the sub-levels is similar so the same principle applies - but I suspect you will just need to amend the top level query to get what you want. |
|
Hamish
Admin Group Joined: 12-October-2006 Location: United Kingdom Status: Offline Points: 56 |
Post Options
Thanks(0)
|
I just re-read your last post - Don't forget the dynamic navigation will, by it's very nature, show all the categories, negating the need for hard coded elements on the main page.
Of course, if there are other reasons for the split that is absolutely fine. You could also split the menu using a small variation on my previous post to have separate Music and Equipment menus. You could also filter on categoryDesc instead of idCategory if you wish. |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |