X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Adding Dynamic Drives Menu (https://forum.x-cart.com/showthread.php?t=64318)

jonwatson87 07-18-2012 03:19 AM

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?

jonwatson87 08-01-2012 02:43 AM

Re: Adding Dynamic Drives Menu
 
Anyone?

JWait 08-29-2012 11:13 AM

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!

totaltec 08-30-2012 09:37 AM

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.


All times are GMT -8. The time now is 10:59 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.