Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Sliding Menu that displays categories and sub-categories

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #21  
Old 07-09-2003, 04:12 PM
 
dealsondeals dealsondeals is offline
 

eXpert
  
Join Date: Dec 2002
Location: Dallas, Texas, USA
Posts: 231
 

Default

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
Reply With Quote
  #22  
Old 07-09-2003, 04:41 PM
 
nuevojefe nuevojefe is offline
 

Member
  
Join Date: Jul 2003
Location: U.S.
Posts: 24
 

Default 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>
Reply With Quote
  #23  
Old 07-09-2003, 05:28 PM
 
nuevojefe nuevojefe is offline
 

Member
  
Join Date: Jul 2003
Location: U.S.
Posts: 24
 

Default version

Oh, in case this is the problem, i'm using version
3.4.1
Reply With Quote
  #24  
Old 07-10-2003, 10:58 AM
 
john80y john80y is offline
 

X-Adept
  
Join Date: May 2003
Posts: 459
 

Default

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.
Reply With Quote
  #25  
Old 07-10-2003, 11:09 AM
 
nuevojefe nuevojefe is offline
 

Member
  
Join Date: Jul 2003
Location: U.S.
Posts: 24
 

Default 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?
Reply With Quote
  #26  
Old 07-25-2003, 01:28 PM
 
komarik komarik is offline
 

Advanced Member
  
Join Date: Jun 2003
Posts: 41
 

Default

so no1 has a solution for this ???
Why are all categories disappear?
Reply With Quote
  #27  
Old 10-05-2003, 10:40 AM
 
Fox Fox is offline
 

Member
  
Join Date: Sep 2003
Posts: 22
 

Default Demo

Is there a demo?

Thanks in advance
Reply With Quote
  #28  
Old 10-20-2003, 01:40 PM
 
cbarning cbarning is offline
 

Advanced Member
  
Join Date: Aug 2003
Posts: 38
 

Default Is there a non javascript version of this.

Is there a non javascript version of this? We are using X-Cart 3.4.6
Reply With Quote
  #29  
Old 10-20-2003, 04:43 PM
 
dealsondeals dealsondeals is offline
 

eXpert
  
Join Date: Dec 2002
Location: Dallas, Texas, USA
Posts: 231
 

Default

[-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
Reply With Quote
  #30  
Old 10-23-2003, 08:00 AM
 
Gibberish Gibberish is offline
 

Senior Member
  
Join Date: Sep 2003
Posts: 182
 

Default

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.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 05:13 AM.

   

 
X-Cart forums © 2001-2020