Forums / All Other Contributions/Addons / Category Tab Simple Dropdown Menu 1.3.9 Support Thread

Category Tab Simple Dropdown Menu 1.3.9 Support Thread

Results 1 to 20 of 47
15 Jun 2011, 18:07
#1
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Posts:
9,707
Plugin Contributions:
6

Category Tab Simple Dropdown Menu 1.3.9 Support Thread

This thread is established to support Category Tab Simple Dropdown Menu version 1.3.9.

To start, this contribution was not authored by me. Version 1.3.9 is a rewrite of the original contribution.

The first step was to create a modified tpl_modules_categories_tabs.php because:

  • Some classes and IDs used in the file were already used in the main stylesheet. This did not create a problem unless a custom template's stylesheet had a change to one of those classes or IDs. Changing the div tags precludes another stylesheet from hijacking the file''s settings.


  • Missing elements in the embedded css style call forced the need for <br /> tags in the tpl or the list would not wrap. However, those tags had to be outside the <li> tags which caused html to fail validation.

The second step was to create a separate stylesheet_catTabsMenu.css because:

  • The css was included in the contribution's php file which was delivered to the browser in a div. This caused the resultant html to fail validation.


  • The css did not include all calls needed to properly adjust the display of the menu items.


  • The css required partly on class or id tags already existing in a standard Zen Cart install. This could cause a conflict in the case of template customization.

This contribution will do the following:

  • List all top-level categories with either the sub-categories or products under them.


  • Validate the html and css with a standard installation of Zen Cart.

This contribution will NOT do the following:

  • List any sub-sub-categories of a top category. For example, in the case of Watches >> Ladies >> Gold, the contribution would show only Watches with Ladies in the dropdown menu.


  • List top-level category products linked to that category. For example, a top-level category of All Ladies Watches with all the products linked from other categories would not show any items in the dropdown menu.

Items that still need to be addressed:

  • The addition of sub-sub-categories in the dropdown menus.


  • The inclusion of linked products in a category's products dropdown.

Please Note: Any changes you wish to make to the "look" of the menu(s) should be done in the stylesheet. Any style changes done in the tpl file will probably cause it to fail html validation.

Of course, as with any Zen Cart file located in the CUSTOM directory, you can make changes to the included as you see fit.
04 Sep 2011, 20:48
#2
lolwaut avatar

lolwaut

Zen Follower

Join Date:
Dec 2010
Posts:
142
Plugin Contributions:
0

Re: Category Tab Simple Dropdown Menu 1.3.9 Support Thread

Hi,

I cant get this mod to work on my site. I've installed the add-on as described in the readme and made sure to turn the add-on to "ON" in Configuration->Layout Settings->Categories-Tabs Menu.

Take a look at my categories menu. The first item ("sub test") is the only category that currently has sub-menus... and it aint workin! Any help is greatly appreciated.

My URL is: http://tinyurl.com/3uttrvu
04 Sep 2011, 23:05
#3
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Posts:
10,324
Plugin Contributions:
0

Re: Category Tab Simple Dropdown Menu 1.3.9 Support Thread

Dbltoe's module influences the behaviour of the categories tabs menu which appears in the HEADER section - not a sidebox. It looks like you are using a Pure_Black template (or one of the "Pure" series) and I think the headers of this template forcefully disable categories-tabs.

If you want to see a categories-tabs dropdown menu in action, GO HERE.
04 Sep 2011, 23:45
#4
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Posts:
9,707
Plugin Contributions:
6

Re: Category Tab Simple Dropdown Menu 1.3.9 Support Thread

Schoolboy is absolutely correct. If you use your Developer's Tool kit in the admin and search for tpl_top_nav.php which is being called by a file that may be overriding basic Zen Cart operation.
I don't want to reopen the discussion on whether these templates work well with mods BUT I do think it's necessary to point out that folks should follow the posting tips when posting.
Instead of our having to research and guess, we could have been quicker are more thorough with more information to start with.
05 Sep 2011, 01:09
#5
sph avatar

sph

Totally Zenned

Join Date:
Jan 2006
Posts:
1,556
Plugin Contributions:
0

Re: Category Tab Simple Dropdown Menu 1.3.9 Support Thread

Very nice, installed and tested in few minutes.

Schoolboy links to a site above. Site has more categories down left column than in drop down header. Is it possible to define what categories you want in the header drop down, if one has alot of categories and too many to go across top?

sph
www.prommart.com
www.fashion-mart.biz (new, candidate for drop down of some kind in near future.)
05 Sep 2011, 01:42
#6
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Posts:
9,707
Plugin Contributions:
6

Re: Category Tab Simple Dropdown Menu 1.3.9 Support Thread

Many things can be adjusted, but the link schoolboy posted is an example of the older version which does not validate.
05 Sep 2011, 06:11
#7
sph avatar

sph

Totally Zenned

Join Date:
Jan 2006
Posts:
1,556
Plugin Contributions:
0

Re: Category Tab Simple Dropdown Menu 1.3.9 Support Thread

Do you know how to code so only certain categories will appear in the top drop down, if you have many more running down the left column?

Anyway, I briefly installed the mod on my new Fashion Mart site. Made a quick drop down background color change to read link. Really looked nice! And it is simple. I now turned it off via .bak on the two files.

I have some experience with the drop down mods and forsee one on my newest site, but still wrestling with the general purpose.

1. SEO: to have all subcategories always "open" to the search engines. (Same with side fly-outs.) But I've noticed no problem with google reaching my "closed" subcategories and products.

2. Customer navigation ease. This may be the more questionable reason, and I've read pros & cons. But right now my new site isn't large enough to hardly warrant a drop down. Don't know. Looks nice, though.

sph
www.prommart.com
www.fashion-mart.biz (up and coming)
05 Sep 2011, 18:30
#8
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Posts:
9,707
Plugin Contributions:
6

Re: Category Tab Simple Dropdown Menu 1.3.9 Support Thread

sph,
Glad it worked and, yes, it's simple.
The only file included with this mod is the one for the includes/templates/CUSTOM/templates/tpl_modules_categories_tabs.php.
It contains the query
$categories_tab_query = "SELECT c.categories_id, cd.categories_name FROM ".TABLE_CATEGORIES." c, ".TABLE_CATEGORIES_DESCRIPTION . " cd WHERE c.categories_id=cd.categories_id AND c.parent_id= '0' AND cd.language_id='" . (int)$_SESSION['languages_id'] . "' AND c.categories_status='1' ORDER BY c.sort_order, cd.categories_name;";
$categories_tab = $db->Execute($categories_tab_query);
The while following the query is what populates the menu with the categories selected.
You will need to "massage" that query in order to change the selection process.
I hope you will understand that this is not a thread to discuss SEO or other items other than problems with the mod or it's installation.
Also, it could muddy the waters if we begin discussing the many ways the mod can be the basis for something way bigger and better.
The mod says Simple and I think this thread should stay simple.
Perhaps someone will PM you with a quote or you can search the Add Ons for more powerful menu mods. Perhaps when 1.5.0 is finalized, someone will make this a more powerful "select your category" option at that time.
I am not the author nor a user of the mod, but modified it to make it validate and operate as the original author intended. With that, I committed to assist with installation and operation problems. We have already seen that template choices even from Zen Cart add ons can effect the operation of this mod. Be sure that any template chosen for your site(s) follow standard Zen Cart process and validate before going further.
05 Sep 2011, 19:50
#9
sph avatar

sph

Totally Zenned

Join Date:
Jan 2006
Posts:
1,556
Plugin Contributions:
0

Re: Category Tab Simple Dropdown Menu 1.3.9 Support Thread

Thanks, it is simple. And the best looking out-of-the-box menu I've tested.
05 Sep 2011, 21:12
#10
lolwaut avatar

lolwaut

Zen Follower

Join Date:
Dec 2010
Posts:
142
Plugin Contributions:
0

Re: Category Tab Simple Dropdown Menu 1.3.9 Support Thread

schoolboy:

Dbltoe's module influences the behaviour of the categories tabs menu which appears in the HEADER section - not a sidebox. It looks like you are using a Pure_Black template (or one of the "Pure" series) and I think the headers of this template forcefully disable categories-tabs.

If you want to see a categories-tabs dropdown menu in action, GO HERE.


Thanks... that clears things up for me. I was after an addon that affected the category sidebox, rather than the header. I found one that works for my purposes called "CSS Flyout Menu." Thanks for the help!
18 Dec 2011, 21:00
#11
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Category Tab Simple Dropdown Menu 1.3.9 Support Thread

@dbltoe

Hi there,

I got involved in a conversation on another thread about breadcrumbs that proved what I believed to be wrong :smile::blush: Anyway I had a look at this mod again and I see that it kind of messes up the breadcrumbs.

this is the chunk of code at fault:

			while (!$subcategories_tab->EOF) 
			{
				$cPath_new=zen_get_path($subcategories_tab->fields['categories_id']);
				$cPath_new=str_replace('=0_', '=', $cPath_new);
				$cPath_new="cPath=".$subcategories_tab->fields['categories_id'];
				echo '<li>'.'<a href="' . zen_href_link(FILENAME_DEFAULT, $cPath_new) . '">'.$subcategories_tab->fields['categories_name'].'</a></li>';
				$subcategories_tab->MoveNext();
			}





Basically the links are being created with only the most 'recent' category. I think this works better.

			while (!$subcategories_tab->EOF) 
			{
				$cPath_new = "cPath=".zen_get_generated_category_path_rev($subcategories_tab->fields['categories_id']);
				echo '<li>'.'<a href="' . zen_href_link(FILENAME_DEFAULT, $cPath_new) . '">'.$subcategories_tab->fields['categories_name'].'</a></li>';
				$subcategories_tab->MoveNext();
			}


Which creates links in the format "cPath=2_11" rather than just "cPath=11". Both will get you to the right place but the first one will result in a correct breadcrumb.
18 Jan 2012, 08:33
#12
4jdesigns avatar

4jdesigns

Zen Follower

Join Date:
Jul 2011
Posts:
106
Plugin Contributions:
0

Re: Category Tab Simple Dropdown Menu 1.3.9 Support Thread

@Nick
Thanks for the breadcrumb fix, works brilliant.

@Everyone else.

I understand that I can only have:
-------------------------------------------------------
- BMW
.......|__ 3 series
.......|__ 5 series
-------------------------------------------------------

But is it all possible to have another dropdown:
-------------------------------------------------------
- BMW
.......|__ 3 series
..............|__ 316
..............|__ 325
.......|__ 5 series
..............|__ 520
..............|__ 525
-------------------------------------------------------

OR just listed below on same dropdown:
-------------------------------------------------------
- BMW
.......|__ 3 series
.......> 316
.......> 325
.......|__ 5 series
.......> 520
.......> 525
-------------------------------------------------------

I don't want to really look for another add on, as this is quite simple and works. Thanks if anyone that can help out.

Jay.
18 Jan 2012, 09:42
#13
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Category Tab Simple Dropdown Menu 1.3.9 Support Thread

4jdesigns

thanks - glad it worked.

the answer, unfortunately, is no, you cannot have more levels of dropdown. that is one of the reasons why it is called 'simple' :smile:

there are other mod out there that do the same thing with more complexity and would allow you to do that. but I would guess that people would want to keep this one pretty simple.
18 Jan 2012, 10:07
#14
4jdesigns avatar

4jdesigns

Zen Follower

Join Date:
Jul 2011
Posts:
106
Plugin Contributions:
0

Re: Category Tab Simple Dropdown Menu 1.3.9 Support Thread

Thanks Nick for a quick reply.

Do you think it would be possible to have the sub-categories drop down as it is, but add a list of its sub-categories just listed below it, similar to that of appliancesdirect.co.uk/ ?
18 Jan 2012, 16:59
#15
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Posts:
21,876
Plugin Contributions:
6

Re: Category Tab Simple Dropdown Menu 1.3.9 Support Thread

That is a "mega-menu" type of dropdown, which is done with one of the other (more complex) CSS dropdown mods.
18 Jan 2012, 18:56
#16
4jdesigns avatar

4jdesigns

Zen Follower

Join Date:
Jul 2011
Posts:
106
Plugin Contributions:
0

Re: Category Tab Simple Dropdown Menu 1.3.9 Support Thread

Cool, thanks for the responses, will have a look at another menu option, but will definitely use it in other projects.
22 Jun 2012, 20:12
#17
danielle avatar

danielle

Totally Zenned

Join Date:
Oct 2004
Posts:
973
Plugin Contributions:
0

Re: Category Tab Simple Dropdown Menu 1.3.9 Support Thread

Having trouble with this mod in IE. I know it's not a problem with the mod because I've got it working on other sites, but I can't figure out what on this site is causing the problem. In FF it displays perfectly, but in IE it's all messed up: www.toobydoo.com

Any suggestions?
22 Jun 2012, 20:43
#18
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Posts:
9,707
Plugin Contributions:
6

Re: Category Tab Simple Dropdown Menu 1.3.9 Support Thread

Most of the time, the problem is bad code that every browser but ie understands. Run your site through the w3c validator to see what's messing with things.
22 Jun 2012, 22:48
#19
danielle avatar

danielle

Totally Zenned

Join Date:
Oct 2004
Posts:
973
Plugin Contributions:
0

Re: Category Tab Simple Dropdown Menu 1.3.9 Support Thread

dbltoe:

Most of the time, the problem is bad code that every browser but ie understands. Run your site through the w3c validator to see what's messing with things.


Yeah I tried that but as far as I could tell all the errors were referring to stuff that is default in zen-cart, like this for example:


Line 174, Column 52: reference not terminated by REFC delimiter

…index.php?main_page=product_info&cPath=2_32&products_id=535"><img src="include…



If you meant to include an entity that starts with "&", then you should terminate it with ";". Another reason for this error message is that you inadvertently created an entity by failing to escape an "&" character just before this text.


I just don't see anything that would be causing the problem that I am having. I'm probably missing something so obvious, I've literally been trying to fix this for an entire day and it's all just a blur now!
22 Jun 2012, 23:24
#20
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Posts:
9,707
Plugin Contributions:
6

Re: Category Tab Simple Dropdown Menu 1.3.9 Support Thread

You need to get a copy of firefox and install firebug and html tidy addons. You have several & that need to be changed to & but the problem that you are addressing probably comes from
<!--<li><a href="index.php?main_page=page&id=43">YOUR LOOKS</a></li>-->
<li><a href="index.php?main_page=page&id=44"">SUBMIT YOUR LOOK</a></li>
Note the double quotes in red.
Also, the meta tag you added needs a closing of /> versus >.