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

Adding Dynamic Drives Menu

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 07-18-2012, 03:19 AM
 
jonwatson87 jonwatson87 is offline
 

Advanced Member
  
Join Date: May 2012
Posts: 32
 

Default Adding Dynamic Drives Menu

I'm trying to add the following menu to the left bar of my store:

http://www.dynamicdrive.com/dynamicindex1/ddsmoothmenu.htm

I've got the following code in 'skin/common_files/customer/meta.tpl'

Code:
{* $Id: meta.tpl,v 1.3.4.1 2012/04/10 11:45:31 aim Exp $ vim: set ts=2 sw=2 sts=2 et: *} <meta http-equiv="Content-Type" content="text/html; charset={$default_charset|default:"utf-8"}" /> <meta http-equiv="X-UA-Compatible" content="IE=8" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <meta http-equiv="Content-Language" content="{$shop_language}" /> {if $printable} <meta name="ROBOTS" content="NOINDEX,NOFOLLOW" /> {else} {meta type='description' page_type=$meta_page_type page_id=$meta_page_id} {meta type='keywords' page_type=$meta_page_type page_id=$meta_page_id} {/if} <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <link rel="stylesheet" type="text/css" href="ddsmoothmenu.css" /> <link rel="stylesheet" type="text/css" href="ddsmoothmenu-v.css" /> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript" src="ddsmoothmenu.js"> /*********************************************** * Smooth Navigational Menu- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com) * This notice MUST stay intact for legal use * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code ***********************************************/ </script> <script type="text/javascript"> {literal} ddsmoothmenu.init({ mainmenuid: "smoothmenu-ajax", //menu DIV id orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v" classname: 'ddsmoothmenu', //class added to menu's outer DIV //customtheme: ["#1c5a80", "#18374a"], contentsource: ["smoothcontainer", "ddsmoothmenu.tpl"] //"markup" or ["container_id", "path_to_menu_file"] }) ddsmoothmenu.init({ mainmenuid: "smoothmenu2", //Menu DIV id orientation: 'v', //Horizontal or vertical menu: Set to "h" or "v" classname: 'ddsmoothmenu-v', //class added to menu's outer DIV //customtheme: ["#804000", "#482400"], contentsource: ["smoothcontainer", "ddsmoothmenu.tpl"] //"markup" or ["container_id", "path_to_menu_file"] }) {/literal} </script>

The rest of the files are in the same directory.

Have I made some sort of error with this code?

I was trying to set it up for AJAX so that I could link to a menu content template from the left bar tpl.

Even before I did this I could only get it to show the root menus, not the sub-items. I looked through the javascript file but couldn't figure out what was going wrong.

I don't have much coding experience, so forgive me if I'm being a bit ditsy!

Anyone know how I should have done this?
__________________
X-Cart Pro 4.5
Reply With Quote
  #2  
Old 08-01-2012, 02:43 AM
 
jonwatson87 jonwatson87 is offline
 

Advanced Member
  
Join Date: May 2012
Posts: 32
 

Default Re: Adding Dynamic Drives Menu

Anyone?
__________________
X-Cart Pro 4.5
Reply With Quote
  #3  
Old 08-29-2012, 11:13 AM
  JWait's Avatar 
JWait JWait is offline
 

X-Man
  
Join Date: Nov 2005
Location: California
Posts: 2,440
 

Default Re: Adding Dynamic Drives Menu

Just a thought but Smarty requires javascript to be inside "literal" tags...

{literal}
Your javascript here.
{/literal}

Also, sometimes there are problems if there is more than one script on the page. One solution is to put the javascript in a language variable and call it that way.
This thread explains it pretty well...

forum.x-cart.com/showthread.php?t=52351

Pay attention to the end of page 1, beginning of page 2.

Good Luck!
__________________
Two Separate X-Cart Stores
Version 4.4.4 Gold - X-AOM - Vivid Dreams Aquamarine (modified) - Linux
Mods - Newest Products - View All -, and a few others. Numerous upgrades from 4.0.x series.
Integrated with Stone Edge Order Manager + POS

Version 4.1.12 Gold (fresh install) - X-AOM - Linux
Mods - XCSEO free
Reply With Quote
  #4  
Old 08-30-2012, 09:37 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Adding Dynamic Drives Menu

Jon there may be other problems, but the glaring one is
HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
You can't declare the DOCTYPE twice! And you are opening <html> again. Both of these things are probably already located in /customer/home.tpl

Dynamic drive's instructions could certainly be improved on this one. Menu looks nice, worth the effort.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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 12:54 AM.

   

 
X-Cart forums © 2001-2020