Jump to content

[Minor] DHTML Categories


Guest gwizard

Recommended Posts

Guest gwizard

File Name :: DHTML Categories

Author :: gwizard

Category :: Minor

CubeCart Version ::

Description

DHTML Categories Mod

by Alon Kobets.

http://www.natalie-shop.com

* README *

This mod will replace the default html categories with DHTML menu that supports Themes.

Coded for CC 3.0.6 and I haven't tested it with any other version, although it should work.

This mod is based on Categories Tree mod by Milos The conVict and part of the credit should go to him.

<XXX> means DIRECTORY !

'XXX' means FILE !

* INSTALL - HOWTO *

1. Copy all files inside <JS> dir to <js> under main shop dir.

2. Go to <main dir>\<includes>\<boxes>\'categories.inc.php' and back it up.

3. Copy the included 'categories.inc.php' to that location overwriting the now backed up file.

4. Go to <your skin>\<styleTemplates>\<boxes>\'categories.tpl' and erase all between the <div class="boxContentRight"> and <div class="boxFootRight">&nbsp;</div>

5. Insert this code instead:

<div id="shopHtmlMenu" align="center">

<ul style="visibility: hidden">

<li><span></span><a href="index.php">{LANG_HOME}</a></li>

<li></li>

{DATA}</li>

</ul>

</div>

<script language="JavaScript" type="text/javascript">

<!--

cmDrawFromText ('shopHtmlMenu', 'vbl', cmThemeIE, 'ThemeIE');

-->

</script>

</div>

Of course here you can change align of the menu, the theme in use and what type of menu it is (horizontal vs vertical).

6. Go to <your skin>\<styleTemplates>\<global>\'index.tpl' and find:

<meta name="keywords" content="{META_KEYWORDS}" />

AFTER ADD:

<script LANGUAGE="JavaScript" SRC="js/JSCookMenu.js" type="text/javascript"></SCRIPT>

<LINK REL="stylesheet" HREF="js/ThemeIE/theme.css" TYPE="text/css" />

<script LANGUAGE="JavaScript" SRC="js/ThemeIE/theme.js" type="text/javascript"></SCRIPT>

Here also you will have to change the theme in use if you changed it in the 'categories.tpl'.

That's it !

Enjoy :-)

View File

Link to comment
Share on other sites

tested it im geting the zip file... robin think its a local problem... make sure zip is still defined to winzip.winrar.explorer and hasn't gone astray to say notepad++

Link to comment
Share on other sites

i found a small bug, on my site not all main categories are display, user can only see if they go with mouse over last category.

You can see here after Navigation is nothing but must display Ortung and Software.

Also i see the box in IE is behind the content, in Opera and Firefox work fine.

Link to comment
Share on other sites

Guest gwizard

Actually, I don't see since you have probably changed back.

Can you change it back so I can see ?

I have checked this in FF and IE, but on the JSCookMenu it says this will work with all the popular browsers exactly the same.

Link to comment
Share on other sites

Guest gwizard

Hmm, is Ortung and Software are both top level categories ?

Because I can see them under Navigation.

I assumed here that top level categories has father id > 0.

Is this correct, dev ppl ?

On the other issue, yes I see it.

Try:

find - cmDrawFromText ('shopHtmlMenu', 'vbl', cmThemeIE, 'ThemeIE');

and change vbl to vbr.

Also I have found another bug with the small image when in subcat. I will fix it soon.

Link to comment
Share on other sites

Hmm, is Ortung and Software are both top level categories ?

Because I can see them under Navigation.

I assumed here that top level categories has father id > 0.

Is this correct, dev ppl ?

yes it is top level 0, i have test it with other name, when i rename "Ortung" to "Artung" i can see it but all Cats after Letter "N" i can not see.

Link to comment
Share on other sites

Guest gwizard

It has nothing to do with language :-)

My shop is in Hebrew and it all shows fine.

Is this a live shop ? Cause I need you to send me your SQLDump of Categories to debug it. Can you do it ?

Link to comment
Share on other sites

yes it is an live shop :-)

I can send you the dump, what you need? the original sql file or csv data?

How i can send you?

Thank you!

PS.: the IE fix will not run

Link to comment
Share on other sites

Guest gwizard

SQL export from phpmyadmin or any other method.

i've sent you my email.

Is anyone else who tried the mod experienced this kind of problem ?

Link to comment
Share on other sites

Guest gwizard

OK.

Go to your categories.inc.php and change the sql statement after ORDER BY to "cat_id DESC"

That should fix your problem, but you will have to live with not alphabetized categories.

This all happened becouse your categories ID's are not in the normal order of creation. You have probably used some tool to automaticly create them from csv or something, right ?

You have also an empty name category which you should really delete. You can do that only from phpmyadmin, btw.

BTW, I did not experienced problems with IE and Killer skin. I am therefore assuming that this has to do with CSS, namely "float: left" line under .colMid or something like that. Try to remove it and see what happens.

Also, about the icon bug...go to the theme.js under <shop>\<js>\<themeIE> and ADD to the path in the first line /shop/ in order it to be absolute.

Link to comment
Share on other sites

This exactly what I needed. I just started working with CubeCart this week. The previous solution used this menu system and my client loved it. They were disappointed when I told them it wasn't available with Cubecart.

I have imported data with CSV and I also am experiencing the problem with some menu level 0 not showing up. It was said above:

This all happened becouse your categories ID's are not in the normal order of creation. You have probably used some tool to automaticly create them from csv or something, right ?

So what IS the "normal order of creation? All 0 levels first and then subcategories, OR Main level, subcategory, subsubcategory, the another Main level, etc?

I will recreate the category file if necessary to get the proper order and all of them showing up.

I also have the same problem with IE "hiding" the flyout menus. Is there a definite fix for that?

Link to comment
Share on other sites

I fixed the IE "hidden flyout menu" problem by adding the following line to layout.css

in .colLeft

add:

z-index: 100;

This worked for me and didn't break Firefox.

Link to comment
Share on other sites

Guest gwizard

I assume you did it with the Classic or Legend skin, right ?

Cause I am working only in Killer and I didn't experience that problem at all.

The normal order of creation, as far as I know (and please correct me if I'm wrong), is first all the top level categories and then subdirectories in no matter what order. That would set all the top level categories with the proper id's for the script to understand.

BUT, you can also use the ORDER BY cat_id DESC and then reformat the output as you see fit.

When I'll have more time, I'll probably add some admin control to this mod (theme, multiple language support, etc) but right now I am codding the Manual Credit Card support :lol:

Link to comment
Share on other sites

gwizard,

Yes I was using the legend skin.

What happens with the category order if after populating the subcategories, you add a new TOP LEVEL category? I guess I'll rebuild the table and give it a try.

Link to comment
Share on other sites

Guest gwizard

Nice to see my ideas in a real world :w00t:

Some of my current work has been killed qwizard. Look at this thread.

Thank you. :lol:

I would be grateful do not anything more with this category mod and do not steal any public spoken ideas please.

Hi, Convict.

I am sorry our dev has clashed, as I didn't saw that post of yours and hadn't been aware that you were planning on releasing javascript menu as well.

I have announced on this earlier when I released my Hebrew lang pack, you know. You could have sent me a PM explaining that you were working on it already.

On the other hand, saying that I stole your idea is pure bullshit as:

1. I didn't saw it.

2. I had announced it week before.

3. EVERY major cart has dhtml menu's so you cannot claim the idea for yourself.

All I did was adding 3 if clauses to your code. That's hardly "Some of my current work has been killed" as you've said.

Final words:

If you think you can do better - DO IT and stop whining.

Link to comment
Share on other sites

Guest gwizard

I do know alot about ethics, how this is relevant if I haven't saw your posts ?

How is this relevant even if I had saw your post ? I gave you the proper credit in the code, in the forum and in the txt file attached. I didn't stole your code and claimed it for my own.

When I want to build something, I do not ask for permission nor I go to the forum and look if anyone has been working on it. I just do it.

To do otherwise would be a waste of time and I have 1.1.2006 deadline and much more work to do.

This is the last post on the subject.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...