| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Sliding Menu that displays categories and sub-categories | ||||
|
|
Thread Tools | Search this Thread |
#21
|
|||||||
|
|||||||
Jeff,
Sorry I couldn't get to you sooner. Good job on figuring things out! Regards, Glen
__________________
Never understimate stupidity. -------- X-Cart Version: 3.5.2 Hosting:mind-in-design.net Configuration: Virtual Dedicated Server || Intel Pentium 4 2.4 GHZ CPU || 1024MB PC2100 DDR RAM || Linux || PHP 4.3.2 || MySQL server 4.0.14 |
|||||||
#22
|
|||||||
|
|||||||
Catagories not appearing
Can you help me identify what is wrong, and why my menus aren't appearing? I put the .js file in the /skin1 directory, and changed the .css file.
Thanks Here is my catagories.tpl: {* $Id: categories.tpl,v 1.16 2002/10/21 07:06:43 zorg Exp $ *} <script language="JavaScript" src="../skin1/slidemenu.js" type="text/javascript"> </script> <script language="JavaScript"> {literal} slideMenu = new createSlideMenu("slideMenu") //Variables to set: slideMenu.menuy=95 //The top placement of the menu. slideMenu.menux=5 //The left placement of the menu slideMenu.useImages = 0 //Are you using images or not? Yes - 1, No - 0 slideMenu.pxspeed=20 //The pixel speed of the animation slideMenu.timspeed=25 //The timer speed of the animation slideMenu.inset = 10 //How much the selected items should pop to the left slideMenu.arrow = 0 //Set this to className that has font-family:webdings //if you want to use the arrow feature. Note: //This ONLY works on DOM capable browsers, and with //useImages set to 0 - It's basically just a test I did. //I hope to improve it later on. //Needed dummy classes - leave in the stylesheet! slideMenu.bgClass = "slideMenuBG" slideMenu.txtClass = "slideMenuText" $ip = '../skin1/images/menu/'; slideMenu.level[0] = new slideMenu_makeLevel( left = 0, width = 138, height = 21, between = 5, className = "clSlideMenu", classNameA = "clA0", regImage = $ip+"level0_regular.gif", roundImg = $ip+"level0_round.gif", roundImg2 = "", subImg = "", subRound= "") slideMenu.level[1] = new slideMenu_makeLevel(10,127,20,2,"clSlideMenu","clA 1",$ip+"level1_regular.gif",$ip+"level1_round2.gif ",$ip+"level1_round.gif",$ip+"level1_sub.gif", $ip+"level1_sub_round.gif") slideMenu.level[2] = new slideMenu_makeLevel(21,118,18,2,"clSlideMenu","clA 2",$ip+"level2_regular.gif",$ip+"level2_round2.gif ",$ip+"level2_round.gif",$ip+"level2_sub.gif", $ip+"level2_sub_round.gif") slideMenu.level[3] = new slideMenu_makeLevel(33,108,20,2,"clSlideMenu","clA 3",$ip+"level3_regular.gif",$ip+"level3_round2.gif ",$ip+"level3_round.gif",$ip+"level3_sub.gif", $ip+"level3_sub_round.gif") slideMenu.level[4] = new slideMenu_makeLevel(40,107,19,2,"clSlideMenu","clA 4",$ip+"level4_regular.gif",$ip+"level4_round2.gif ",$ip+"level4_round.gif",$ip+"level4_sub.gif", $ip+"level4_sub_round.gif") //Image preload --- leave this for(var i=0;i<slideMenu.level;i++){ var l = slideMenu.level[i] new preLoadBackgrounds(l.regImage,l.roundImg,l.roundIm g2,l.subImg,l.subRound) } {/literal} {php} function find_idx($a, $label) { while( list($k,$v) = each($a) ){ if( isset($v['label']) && $v['label'] == $label ) return $k; } return -1; } function cmp($a, $b) { if( $a['orderby'] == $b['orderby'] ) return 0; return ($a['orderby'] < $b['orderby'] ) ? -1 : 1; } function sort_cat(&$list) { while( list($k,$v) = each($list) ){ if( isset($v['sub']) ) usort(&$v['sub'],'cmp'); } usort($list,'cmp'); } function preparelist($list) { $r = array(); $c = false; $cnt = 1; while (list ($k, $v) = each ($list) ){ $l = split('/',$v['category']); // init tree $p = & $r; for( $i=0; $i<sizeof($l); $i++ ){ $idx = find_idx($p,$l[$i]); $lastest = ( $i == sizeof($l)-1 ); if( $idx == -1 ) { if( $lastest ){ if( isset($p[0]) && isset($p[0]['orderby']) && $p[0]['orderby'] > $v['order_by']){ array_unshift($p, array( 'label'=>$l[$i] ) ); $idx = 0; } else { array_push($p, array( 'label'=>$l[$i] ) ); $idx = sizeof($p)-1; } } else { array_push($p, array( 'label'=>$l[$i] ) ); $idx = sizeof($p)-1; } } $p = & $p[$idx]; if( $lastest ) $p['orderby'] = $v['order_by']; // set url if( $lastest ) $p['url'] = $v['categoryid']; else { if( !isset( $p['sub'] ) ) $p['sub'] = array(); $p = & $p['sub']; } } $cnt++; } return $r; } function fill_menu($menu,$level) { switch( $level ){ case '0': $l = 'top'; break; case '1': $l = 'sub'; break; default: $l = 'sub'.$level; break; } while ( list($idx,$cnt) = each($menu) ){ $item = $menu[$idx]; $label = addslashes($item['label']); if( isset($item['sub']) ){ print "slideMenu.makeMenu('$l',\"$label\");\n"; fill_menu($item['sub'],$level+1); } else print "slideMenu.makeMenu('$l',\"$label\",'home.php?cat= ".$item['url']."');\n"; } } $list = preparelist($allcategories); sort_cat(&$list); fill_menu($list,0); print "slideMenu.init();\n\n"; {/php} </SCRIPT> <TABLE border=0 cellPadding=5 cellSpacing=0 width=100%> <!-- <TR> <TD height=26 width=26 valign=center>[img]{$ImagesDir}/dingbats_categorie.gif[/img]</TD> <TD height=26 valign=center width="80%"><FONT class=VertMenuTitle>{$lng.lbl_categories}</FONT></TD> </TR> --> <tr><td colspan=2 nowrap> {if $config.General.root_categories eq "Y"} {/if} </td></tr> </TABLE> |
|||||||
#23
|
|||||||
|
|||||||
version
Oh, in case this is the problem, i'm using version
3.4.1 |
|||||||
#24
|
|||||||
|
|||||||
I have the same problem in that my categories disapeared...
Fortunatly I set up a test server and nothing was lost for me It does look sweet and I would really like to use it. |
|||||||
#25
|
|||||||
|
|||||||
test server
I've reset everything so all is well, but I would really like to use this menu, on second thought though, I'm wondering how this would affect the search engines ability to crawl static pages that I would generate after implementing this slide menu?
|
|||||||
#26
|
|||||||
|
|||||||
so no1 has a solution for this ???
Why are all categories disappear? |
|||||||
#27
|
|||||||
|
|||||||
Demo
Is there a demo?
Thanks in advance |
|||||||
#28
|
|||||||
|
|||||||
Is there a non javascript version of this.
Is there a non javascript version of this? We are using X-Cart 3.4.6
|
|||||||
#29
|
|||||||
|
|||||||
[-o< ok, ok
First, I do not have a non-javascript version of this MOD. Second it was developed on 3.3.x branch several months ago - eight months ago to be exact. I will look at updating it for 3.4.x branch very soon, probably within the next two-to-three weeks. Regards, Glen
__________________
Never understimate stupidity. -------- X-Cart Version: 3.5.2 Hosting:mind-in-design.net Configuration: Virtual Dedicated Server || Intel Pentium 4 2.4 GHZ CPU || 1024MB PC2100 DDR RAM || Linux || PHP 4.3.2 || MySQL server 4.0.14 |
|||||||
#30
|
|||||||
|
|||||||
would love to see this mod for 3.4.x
That is really one of the best parts about Xcart, all the support from fellow users and helpful mods. |
|||||||
|
|||
X-Cart forums © 2001-2020
|