Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 07-02-2009 15:41:46

dh783
Member
From: Avondale, Arizona
Registered: 04-06-2005
Posts: 6233
Website

Mod::Dynamic FrontEnd Menu with 3 Sub-Categories Display.

Here is a mod I have been working on in the last week to see if I could build a dynamic vertical menu with sub-category fly-outs. I haven't seen any problems yet on the browsers I have tested it on with the exception of FF on Mac which I think is coming from some of the developer extensions I have installed into FF as when I tested on a machine that had a standard install of FF it worked with out a problem, other wise it was a little slow responding and the menus collapsed when the pointer rested a bit.

Your going to change some core scripts here so it will be subject to be overwritten in updates and as always you should make copies of the files affected just in case.

This is going to be a long post but we will first start with a new row in the khxc_settings database at Home > ClickCartPro > Database: Connections, Backups and Raw Admin > Raw Database Admin with the following (UK versions should change all occurrences of ccp0 to gbu0):

id               = ccp0.menusubdisp
name         = Front Menu Sub-Category Display.
app            = ccp0
section       = Catalog Global Displays
displaytype = SELECT-CUSTOM
displaydata = ccp0.submenudisp
required     = 1
value         = 3
descripton  = Select the number of sub-categories to be displayed under main menu items.

next create 4 new entries into the khxc_selectcustom database:

id               = ccp0.submenudisp.0
app            = ccp0
selectid      = ccp0.submenudisp
selectname = No Sub-Categories
selectvalue = 0
selectorder = 0

id               = ccp0.submenudisp.1
app            = ccp0
selectid      = ccp0.submenudisp
selectname = One Sub-Categories
selectvalue = 1
selectorder = 1

id               = ccp0.submenudisp.2
app            = ccp0
selectid      = ccp0.submenudisp
selectname = Two Sub-Categories
selectvalue = 2
selectorder = 2

id               = ccp0.submenudisp.3
app            = ccp0
selectid      = ccp0.submenudisp
selectname = Three Sub-Categories
selectvalue = 3
selectorder = 3

This will give you a new field in settings/Catalog Global Displays which will allow you to either limit the number of sub-categories or turn it off completely.
Next in the skin you are using you will need to place this java script in it's script directory which I originally got from Dymanic Drive  for there SuckerTree UL menu but any java script that deals with ul list should be able to be used for this

I named my file femenu.js

Code:

//SuckerTree Vertical Menu 1.1 (Nov 8th, 06)
//By Dynamic Drive: http://www.dynamicdrive.com/style/

var menuids=["skin_fenav1"] //Enter id(s) of SuckerTree UL menus, separated by commas

function buildsubmenus(){
for (var i=0; i<menuids.length; i++){
  var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
    for (var t=0; t<ultags.length; t++){
    ultags[t].parentNode.getElementsByTagName("a")[0].className="subfolderstyle"
          if (ultags[t].parentNode.parentNode.id==menuids[i]) //if this is a first level submenu
               ultags[t].style.left=ultags[t].parentNode.offsetWidth+"px" //dynamically position first level submenus to be width of main menu item
          else //else if this is a sub level submenu (ul)
            ultags[t].style.left=ultags[t-1].getElementsByTagName("a")[0].offsetWidth+"px" //position menu to the right of menu item that activated it
    ultags[t].parentNode.onmouseover=function(){
    this.getElementsByTagName("ul")[0].style.display="block"
    }
    ultags[t].parentNode.onmouseout=function(){
    this.getElementsByTagName("ul")[0].style.display="none"
    }
    }
          for (var t=ultags.length-1; t>-1; t--){ //loop through all sub menus again, and use "display:none" to hide menus (to prevent possible page scrollbars
          ultags[t].style.visibility="visible"
          ultags[t].style.display="none"
          }
  }
}

if (window.addEventListener)
window.addEventListener("load", buildsubmenus, false)
else if (window.attachEvent)
window.attachEvent("onload", buildsubmenus)

now you will need to add or update some css entries in the skin's all.css, most of these should be in a standard ccp file but if you have a custom skin all bets are off, this is my total css for my menu (Most of these css rules currently exist but they have been changed from there default ccp rules).

Code:

.skin_fenav ul {
     color: inherit;
     background-color: inherit; 
     padding: 0px;
     margin: 0px 0px 10px 0px;
     list-style: none;
     width: auto;
     }

.skin_fenav ul li {
     color: inherit;
     background-color: inherit; 
     padding: 0px;
     margin: 0px;
     border-bottom: 1px solid #CDCDCD;
     list-style: none;
     position: relative;
     }

.skin_fenav ul li a {
     color: #333333;
     background-color: inherit; 
     font-weight: normal;
     display: block;
     text-decoration: none;
     padding: 3px 5px 3px 5px;
     overflow: auto; /*force hasLayout in IE7 */
     }

.skin_fenav ul li a:hover {
     color: #333333;
     background-color: #CCCCCC;
     text-decoration: none;
     }

/* add to css */

.skin_fenav ul li ul {
     position: absolute;
     width: 130px; /*sub menu width*/
     top: 4px;
     visibility: hidden;
     background-color: #FFFFFF;
     background-repeat: repeat; 
     border: 2px solid #C2C2C2;
     z-index: 4;
}

.subfolderstyle {
    background: url(navarrow.png) no-repeat center right; 
} 

/* end of add */

you may need to fine tune the css to fit your site and even create a navearrow (or what ever you name it) picture for the subforderstyle if you want it to display and or correct the url paths.
In the java scrip the variable var menuids=["skin_fenav1"] needs to hold the name of the menu we are going to build, you will notice that it is different than the css (with an add 1 in the name) which I will explain latter but can be anything.

Next place a call for the java script in the head section of the skin's skin.php file, replace "your_skin_name" with the id of your skin

Code:

<script type="text/javascript" src="skins/your_skin_name/scripts/femenu.js"></script>

Now comes the really fun part, we are going to edit two core files, the first resides in the private_dir/your_directory_name/apps/{app}/CCP/ext  ({app} is either ccp0 or gbu0), in the script femenus.php where we are going to edit the Function: menucategories I am going to post the entire function but all edits are surrounded or pre-seeded by the commit "SLP"

Code:

// +------------------------------------------------------------------+
// | Function: menucategories                                         |
// +------------------------------------------------------------------+

function menucategories () {

// +--
// | This function prints the categories menu.
// +--
// +---
// | SLP added to get setting for sub-category display.
// +---

$sublevel = $this->globals('khxc_settings.' . $this->app . '.menusubdisp');

// +---------------

$table = $this->app . '_cat';

// +---
// | SLP added xcat to fields pulled.
// +---

$sql  = "SELECT id, name, xcat FROM {$table} WHERE splashdisp=";
$sql .= $this->KHXC_DB->quote(1) . " AND ";

// +--
// | Handle visibility.
// +--

$usergroup = $this->globals('khxc_user.usergroup');

if (empty($usergroup)) {
 
     $sql .= 'catview=' . $this->KHXC_DB->quote('A');

} else {

     $sql .= '((catview=' . $this->KHXC_DB->quote('A') . ') OR ';
     $sql .= '(catview=' . $this->KHXC_DB->quote('L') . ' AND ';
     $sql .= '(catviewg LIKE ' . $this->KHXC_DB->quote_like($usergroup . ',', 'SUFFIX') . ' OR ';
     $sql .= 'catviewg LIKE ' . $this->KHXC_DB->quote_like(','  . $usergroup, 'PREFIX') . ' OR ';
     $sql .= 'catviewg LIKE ' . $this->KHXC_DB->quote_like(', '  . $usergroup, 'PREFIX') . ' OR ';
     $sql .= 'catviewg LIKE ' . $this->KHXC_DB->quote_like(','  . $usergroup . ',', 'WRAP') . ' OR ';
     $sql .= 'catviewg LIKE ' . $this->KHXC_DB->quote_like(', '  . $usergroup . ',', 'WRAP') . ' OR ';
     $sql .= 'catviewg='       . $this->KHXC_DB->quote($usergroup) . ')))';

} // End of if statement.

// +--
// | Execute the query.
// +--

$result = $this->KHXC_DB->sql_do(array('sql'    => $sql,
                                       'table'  => $table,
                                       'order'  => array('sortorder' => 'ASC')));

if ($this->IsError($result)) {return 1;}
if (empty($result))          {return 1;}

// +--
// | Build the menu array.
// +--

$menu_array = array();

// +---
// | SLP Get the categories that are not main displays.
// +---

$sql  = "SELECT id, name, xcat FROM {$table} WHERE splashdisp=";
$sql .= $this->KHXC_DB->quote(0);

$result2 = $this->KHXC_DB->sql_do(array('sql'  => $sql,
                                        'table' => $table,
                                        'order' => array('sortorder' => 'ASC')));

// +---------------------------------

$sub1 = '';
$sub2 = '';
$sub3 = '';

foreach ($result as $num => $row) {

// +---
// | SLP added for fly-out menu.
// +---

  If (($sublevel >= '1') && (!(empty($row['xcat'])))) {

// +---
// | Setup first level fly-out.
// +---

    $xsub1 = explode(",",$row['xcat']);

    foreach ($xsub1 as $num => $xrow) {

      $xid = trim($xrow," ,\n,\r");

// +---
// | Setup second level fly-out.
// +---

    foreach ($result2 as $num => $xresult2) {

       if ($xid == $xresult2['id']) {

          $xsub2 = explode(",",$xresult2['xcat']);

          $name = $xresult2['name'];

       } // End of if statement.

     } // End of foreach statement.

    if (($sublevel >= '2') && (!(empty($xsub2[0])))) {

      foreach ($xsub2 as $num => $xrow2) {

        $xid2 = trim($xrow2," ,\n,\r");

// +---
// | Setup third level fly-out.
// +---

         foreach ($result2 as $num => $xresult3) {

           if ($xid2 == $xresult3['id']) {

              $name2 = $xresult3['name'];

              $xsub3 = explode(",", $xresult3['xcat']);

           } // End of if statement.

         } //  End of foreach statement.

               if (($sublevel == '3') && (!(empty($xsub3)))) {

                  foreach ($xsub3 as $num => $xrow3) {

                     $xid3 = trim($xrow3,"\n, ,\r");

                         foreach ($result2 as $num => $xresult4) {

                           if ($xid3 == $xresult4['id']) {$name3 = $xresult4['name'];}

                         } // End of foreach statement.

// +---
// | Build third level array.
// +---

                    if (!(empty($name3))) {

                         $sub3[] = array('text'      => $name3,
                                         'app'       => $this->app,
                                         'namespace' => 'catshow',
                                         'params'    => array('ref' => $xid3));

                        unset($name3);

                    } // End of if statement.

               } // End of foreach statement.

             } // End of if statement.

// +---
// | Build second level array.
// +---

          if (!(empty($name2))) {

               $sub2[] = array('text'      => $name2,
                               'app'       => $this->app,
                               'namespace' => 'catshow',
                               'params'    => array('ref' => $xid2),
                               'sub3'      => $sub3);

               unset($name2);

          } // End of if statement.

               $sub3 = '';

        } // End of foreach statement.

      } // End of if statement.

// +---
// | Build first level array.
// +---

      if (!(empty($name))) {

            $sub1[] = array('text'      => $name,
                            'app'       => $this->app,
                            'namespace' => 'catshow',
                            'params'    => array('ref' => $xid),
                            'sub2'      => $sub2);

        unset($name);

      } // End of if statement.

        $sub2 = '';

    } // End of foreach statement.

  } // End of if statement.

// +---------------------------------
// | SLP add subcat and css key to menu_array, css as a
// | triger to determain which menu is being built
// | in the menu included.
// +---

     $menu_array[] = array('text'      => $row['name'],
                           'app'       => $this->app,
                           'namespace' => 'catshow',
                           'params'    => array('ref' => $row['id']),
                           'subcat'    => $sub1,
                           'css'       => 'skin_fenav1');

// +---
// | SLP add for fly-out menu.
// +---

$xsub1 = '';
$sub1   = '';

// +------------

} // End of foreach statement.

// +--
// | Globalize the menu array.
// +--

$this->globals('khxc_app.femenu_array',$menu_array);

// +--
// | Print the generic frontend menu includes and log that we were here.
// +--

$this->KHXC_Display->include_file($this->app,'femenuhead.php');

$this->KHXC_Display->include_file($this->app,'femenugeneric.php');

$this->KHXC_Display->include_file($this->app,'femenufoot.php');

if ($this->debug) {$this->debugger("menupages: Printed the CCP categories menu.  App: {$this->app}");}

// +--
// | Return true.
// +--

return 1;

} // End of function.

The second script resides in the private_dir/your_directory_name/apps/{app}/CCP/includes by the name of femenugeneric.php, again the whole script. This is where the menu name used in the java script needs to be the name of the ul id in this line "print '<ul id="skin_fenav1">' . $eol; " in the include

Code:

<?php 

$eol              = $this->globals('khxc.eol');
$femenu_array     = $this->globals('khxc_app.femenu_array');

if (!(empty($femenu_array))) {

   if (!(empty($femenu_array[0]['css']))) {

     print '<ul id="skin_fenav1">' . $eol;

   } else {

     print '<ul>' . $eol;

   } // End of if statement.

     foreach ($femenu_array as $num => $data) {

          $text = $this->xhtml_encode($data['text']);

          $link = $this->link_namespace($data['app'],$data['namespace'],$data['params']);

          print '     <li><a href="' . $link . '" title="' . $text . '">';

//+---
//| Setup the first menu fly out if we have information.
//+---

          if (!(empty($data['subcat']))) {

             $xsub1 = $data['subcat'];

             print $text . '</a>' . $eol;
             print '<ul>' . $eol;

               foreach ($xsub1 as $num => $xdata) {

                 $textsub1 = $this->xhtml_encode($xdata['text']);

                 $linksub1 = $this->link_namespace($xdata['app'],$xdata['namespace'],$xdata['params']);

                 print '     <li><a href="' . $linksub1 . '" title="' . $textsub1 . '">';

//+---
//| Setup the second menu fly out if we have information.
//+---

                    if (!(empty($xdata['sub2']))) {

                        $xsub2 = $xdata['sub2'];

                        print $textsub1 . '</a>' . $eol;
                        print '<ul>' . $eol;

                          foreach ($xsub2 as $xdata2) {

                             $textsub2 = $this->xhtml_encode($xdata2['text']);

                             $linksub2 = $this->link_namespace($xdata2['app'],$xdata2['namespace'],$xdata2['params']);

                             print '     <li><a href="' . $linksub2 . '" title="' . $textsub2 . '">';

//+---
//| Setup the third menu fly out if we have information.
//+---

                    if (!(empty($xdata2['sub3']))) {

                        $xsub3 = $xdata2['sub3'];

                        print $textsub2 . '</a>' . $eol;
                        print '<ul>' . $eol;

                          foreach ($xsub3 as $xdata3) {

                             $textsub3 = $this->xhtml_encode($xdata3['text']);

                             $linksub3 = $this->link_namespace($xdata3['app'],$xdata3['namespace'],$xdata3['params']);

                             print '     <li><a href="' . $linksub3 . '" title="' . $textsub3 . '">';
                             print $textsub3 . '</a></li>' . $eol;

                          } // End of foreach statement.

                       print '</ul>' . $eol;
                       print '</li>' . $eol;

                       unset($xsub3);

                    } else {

                       print $textsub2 . '</a></li>' .  $eol;

                    } // End of if statement.

                          } // End of foreach statement.

                       print '</ul>' . $eol;
                       print '</li>' . $eol;

                       unset($xsub2);

                    } else {

                       print $textsub1 . '</a></li>' .  $eol;

                    } // End of if statement.

               } // End of foreach statement.

              print '</ul>' . $eol;
              print '</li>' . $eol;

              unset($xsub1);

         } else {

          print $text . '</a></li>' . $eol;

        } // End of if statement.

     } // End of foreach statement.

     print '</ul>' . $eol . $eol;

} // End of if statement.

?>

If all is done correctly you will have a main menu display that will contain up to three levels of sub-categories, categories will be displayed in the order they are placed into each categories Related Categories fields (xcat). Since it all takes place after the menus are checked for the user group only those menu that the group is allowed to see will be displayed and at this time no main menu item will be displayed as a sub-cateogry but can be changed if needed. If you have a large number of menu items this may cause a longer load time but on my site I haven't seen any delays that I can say are from this mod and at this time it is building around 100 menu items.

Have fun.

John

Last edited by dh783 (09-04-2010 22:28:32)

Offline

 

#2 04-30-2010 12:18:09

jensme
Member
Registered: 04-29-2010
Posts: 392

Re: Mod::Dynamic FrontEnd Menu with 3 Sub-Categories Display.

Would you mind posting a demo of what this looks like?  Thanks! 

I want to do something like this, but not with flyouts.  I'd like to display all active categories right on the left hand side of the page.

Offline

 

#3 04-30-2010 17:49:42

sushisushi
Member
From: barnsley, UK
Registered: 06-26-2008
Posts: 88
Website

Re: Mod::Dynamic FrontEnd Menu with 3 Sub-Categories Display.

Hi John,

I seem to have done it all but it's not worjing. I'm not a JS or PHP guru to be honest.

I have mainly stumbled on this point:

"This is where the menu name used in the java script needs to be the name of the ul id in this line "print '<ul id="skin_fenav1">' . $eol; " in the include"

I just don't get it at all.

Can you take a look at my site and offer an explanation why it's not working?

Thanks for all your help!


Buy sushi making ingredients, sushi party kits and Japanese food at wwwsushisushi.co.uk

Offline

 

#4 04-30-2010 18:32:37

dh783
Member
From: Avondale, Arizona
Registered: 04-06-2005
Posts: 6233
Website

Re: Mod::Dynamic FrontEnd Menu with 3 Sub-Categories Display.

You have the code for the menu, so that is ok, thru FF webtools it saying that it cant find the java script, look at that and make sure that the script is in the correct place and has the name your looking for. Here is the info returned by FF

Code:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /store/skins/zipskin_khxc015/scripts/femenu.js was not found on this server.</p>
<hr>
<address>Apache/2.2.3 (CentOS) Server at www.sushisushi.co.uk Port 80</address>
</body></html>

John

Offline

 

#5 05-01-2010 03:35:14

sushisushi
Member
From: barnsley, UK
Registered: 06-26-2008
Posts: 88
Website

Re: Mod::Dynamic FrontEnd Menu with 3 Sub-Categories Display.

hi john,

yes the script is in the correct folder.

May be I got the script wrong. I copied and pasted the code you posted into a txt file then saved it with a .js extention.

Will this work to create a .js file or will I need dreamweaver? I don't have a web design program believe it or not!


Buy sushi making ingredients, sushi party kits and Japanese food at wwwsushisushi.co.uk

Offline

 

#6 05-01-2010 05:02:26

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: Mod::Dynamic FrontEnd Menu with 3 Sub-Categories Display.

What you did will work but, as John pointed out, the JS file is not where it is supposed to be. If you go to http://www.sushisushi.co.uk/store/skins … /femenu.js the JS file will not be found and that is where it is being looked for.

Offline

 

#7 05-01-2010 05:11:16

sushisushi
Member
From: barnsley, UK
Registered: 06-26-2008
Posts: 88
Website

Re: Mod::Dynamic FrontEnd Menu with 3 Sub-Categories Display.

you know what I did? I put an "s" on the end of the .js file! doh!

Now the .js file can be found so sorted that. But unfortunately it's still not working. Any other ideas?

Thanks for the help guys, I've been trying to get flyout menus working for months now...


Buy sushi making ingredients, sushi party kits and Japanese food at wwwsushisushi.co.uk

Offline

 

#8 05-01-2010 09:40:33

dh783
Member
From: Avondale, Arizona
Registered: 04-06-2005
Posts: 6233
Website

Re: Mod::Dynamic FrontEnd Menu with 3 Sub-Categories Display.

jensme wrote:

Would you mind posting a demo of what this looks like?  Thanks!

You can look at my site (ccp7 but still the basic result), or fixmyrust .com which is using this mod and has quite a large menu that is being built.

John

Offline

 

#9 05-01-2010 11:22:12

dh783
Member
From: Avondale, Arizona
Registered: 04-06-2005
Posts: 6233
Website

Re: Mod::Dynamic FrontEnd Menu with 3 Sub-Categories Display.

sushisushi,

When I view your java script thru FF webtools, the femenu.js displays as one long line, when I view my femenu.js file it is blocked out like in this forum. My thought is that if your site is treating the java script as one line then the first comment in the script is killing the rest of the script. The line feeds may not have been captured when you copied the script so edit your femenu.js file and make sure it looks like it's posted here or at least the line breaks are the same.

On another note I checked your css files thru the css validator and it came up with 17 errors and 11 warnings which you may want to fix. There where also problems with the html when validated which you may want to check also.

John

Last edited by dh783 (05-01-2010 11:24:13)

Offline

 

#10 05-04-2010 05:00:59

ZipSkins
Member
From: United Kingdom
Registered: 01-15-2006
Posts: 822
Website

Re: Mod::Dynamic FrontEnd Menu with 3 Sub-Categories Display.

Regarding the problem that Stuart (sushisushi) is having:-

This involves ZipSkin khxc015, and I have now tested this. The instructions John provides will work, but an additional change to the all,css file is required. You need to amend the #skin_ct_lcol style, and change the overflow setting as follows:-

overflow: visible;

In other respects I simply followed John's instructions, making the necessary amendments for gbu0 in place of ccp0. Within the css, you can use the existing padding, background colours and images to maintain a consistent appearance.

Nigel


| Professional Quality Customisable Skins for your ClickCartPro Powered Site


-----------------------------
Certified Support Partner

Offline

 

#11 05-04-2010 08:02:08

dh783
Member
From: Avondale, Arizona
Registered: 04-06-2005
Posts: 6233
Website

Re: Mod::Dynamic FrontEnd Menu with 3 Sub-Categories Display.

Design_Wholesale,

I would check the php edits, as a blank screen would to indicate a syntax problem some where in the edit.

John

Offline

 

#12 07-20-2010 19:19:02

Design_Wholesale
Member
From: England!
Registered: 11-21-2008
Posts: 1104
Website

Re: Mod::Dynamic FrontEnd Menu with 3 Sub-Categories Display.

This works, but the CSS is a serious hassle to configure correctly.

I actually had to copy the following  as given in the fixmyrust.com CSS file, and overwrite the corresponding values in my CSS file save for the two new additions as given by John.

Code:

.skin_fenavh {
     color: #FFFFFF;
     background-color: #869655;
     padding: 3px 5px 3px 5px;
     margin: 0px 0px 0px 0px;
     border: 1px solid #000000;
     font-weight: bold;
     }

.skin_fenav ul {
     color: inherit;
     background-color: inherit; 
     padding: 0px;
     margin: 0px 0px 10px 0px;
     list-style: none;
     width: auto;
     }

.skin_fenav ul li {
     color: inherit;
     background-color: inherit; 
     padding: 0px;
     margin: 0px;
     border-bottom: 1px solid #CDCDCD;
     list-style: none;
     position: relative;
     }

.skin_fenav ul li a {
     color: #333333;
     background-color: inherit; 
     font-weight: normal;
     display: block;
     text-decoration: none;
     padding: 3px 5px 3px 5px;
     overflow: auto; /*force hasLayout in IE7 */
     }

.skin_fenav ul li a:hover {
     color: #333333;
     background-color: #CCCCCC;
     text-decoration: none;
     }

.skin_fenav ul li ul {
     position: absolute;
     width: 130px; /*sub menu width*/
     top: 4px;
     visibility: hidden;
     background-color: #FFFFFF;
     background-repeat: repeat; 
     border: 2px solid #C2C2C2;
     z-index: 4;
}

.subfolderstyle {
    background: url(navarrow.png) no-repeat center right; 
}

Also make absolutely certain that entries like the one above, for the navarrow.png, are correct. - If the file name is wrong for your site, or the path details incorrect, then not only will you have no arrows/pointers/whatever but you might also (as I did) encounter a weird problem with unauthenticated content when trying to view pages on your site using HTTPS with browsers like Firefox and Opera.  Anyway, the flyout menu works perfectly on our site, now. - Thank-you, John.

Last edited by Design_Wholesale (07-23-2010 09:30:38)

Offline

 

#13 07-20-2010 19:25:06

dh783
Member
From: Avondale, Arizona
Registered: 04-06-2005
Posts: 6233
Website

Re: Mod::Dynamic FrontEnd Menu with 3 Sub-Categories Display.

Make sure that all the css rules are in place for this mod.

John

Last edited by dh783 (08-04-2010 13:25:00)

Offline

 

#14 07-21-2010 04:01:55

sushisushi
Member
From: barnsley, UK
Registered: 06-26-2008
Posts: 88
Website

Re: Mod::Dynamic FrontEnd Menu with 3 Sub-Categories Display.

ZipSkins wrote:

Regarding the problem that Stuart (sushisushi) is having:-

This involves ZipSkin khxc015, and I have now tested this. The instructions John provides will work, but an additional change to the all,css file is required. You need to amend the #skin_ct_lcol style, and change the overflow setting as follows:-

overflow: visible;

In other respects I simply followed John's instructions, making the necessary amendments for gbu0 in place of ccp0. Within the css, you can use the existing padding, background colours and images to maintain a consistent appearance.

Nigel

Just got this nige, thanks ill give it a bash soon.


Buy sushi making ingredients, sushi party kits and Japanese food at wwwsushisushi.co.uk

Offline

 

#15 08-04-2010 13:23:15

dh783
Member
From: Avondale, Arizona
Registered: 04-06-2005
Posts: 6233
Website

Re: Mod::Dynamic FrontEnd Menu with 3 Sub-Categories Display.

When you say

Design_Wholesale wrote:

prevent your Catalog Global Displays from displaying in the backend.

just what display are you talking about? This mod should only effect the front end display menu and I am unaware of any display that presents a display like this in the backend, at least in the US version. If there where a display like this in the GBU version and it was trying to use the same script then the app would be wrong and it would not be able to pull the include.

John

Offline

 

#16 08-04-2010 13:26:38

Design_Wholesale
Member
From: England!
Registered: 11-21-2008
Posts: 1104
Website

Re: Mod::Dynamic FrontEnd Menu with 3 Sub-Categories Display.

Using  as a  value blanks out the display of



Other values taken from the database, or as clones of existing fields, work fine.  The mod works fine, too, and, as I said in my last post, I suspect that the problem is nothing more than trying to use a non-existant value in the  field.

Last edited by Design_Wholesale (08-04-2010 13:48:53)

Offline

 

#17 08-04-2010 13:47:52

dh783
Member
From: Avondale, Arizona
Registered: 04-06-2005
Posts: 6233
Website

Re: Mod::Dynamic FrontEnd Menu with 3 Sub-Categories Display.

Ok, your talking about the new fields created in the setting database and the corresponding selection items. Check the entries for the selection items created in database khxc_selectcustom, the displaydata field tells the system to look for entries containing that information, in your case using gbu0.submenudisp so  the system is looking for entries in the selectcustom database of gbu0.submenudisp.xxx (0 = zero), if it can't find them then it will error out and not display.

John

Last edited by dh783 (08-04-2010 13:48:39)

Offline

 

#18 08-04-2010 14:19:49

dh783
Member
From: Avondale, Arizona
Registered: 04-06-2005
Posts: 6233
Website

Re: Mod::Dynamic FrontEnd Menu with 3 Sub-Categories Display.

The entries in the khxc_selectcustom data base should be

Code:

id               = gbu0.submenudisp.0
app            = gbu0
selectid      = gbu0.submenudisp
selectname = No Sub-Categories
selectvalue = 0
selectorder = 0

id               = gbu0.submenudisp.1
app            = gbu0
selectid      = gbu0.submenudisp
selectname = One Sub-Categories
selectvalue = 1
selectorder = 1

id               = gbu0.submenudisp.2
app            = gbu0
selectid      = gbu0.submenudisp
selectname = Two Sub-Categories
selectvalue = 2
selectorder = 2

id               = gbu0.submenudisp.3
app            = gbu0
selectid      = gbu0.submenudisp
selectname = Three Sub-Categories
selectvalue = 3
selectorder = 3

Offline

 

#19 08-04-2010 16:40:54

Design_Wholesale
Member
From: England!
Registered: 11-21-2008
Posts: 1104
Website

Re: Mod::Dynamic FrontEnd Menu with 3 Sub-Categories Display.

Fixed it! - Thanks John - this beautiful mod is now working perfectly in our webstore, again, and  any problems with  now.

For anyone else following the above directions and getting a blank page, try checking to make sure that any recent database restorations haven't corrupted anything (as was the case in my store); also, if there is something bad in one of the records, eg: , try

Code:

DELETE from khxc_selectcustom

as a MySQL statement before importing any backup. - Be careful, - some DELETE froms will prevent your backend from functioning, eg: deleting the  record.

Last edited by Design_Wholesale (08-04-2010 16:42:40)

Offline

 

#20 08-29-2010 01:07:32

fazman
Member
From: Aus
Registered: 03-19-2006
Posts: 196
Website

Re: Mod::Dynamic FrontEnd Menu with 3 Sub-Categories Display.

sushisushi wrote:

you know what I did? I put an "s" on the end of the .js file! doh!

Now the .js file can be found so sorted that. But unfortunately it's still not working. Any other ideas?

Thanks for the help guys, I've been trying to get flyout menus working for months now...

Guys I just had the same problem and worked out why.

In the instructions it mentions calling the file femenus.js not femenu.js I reread it and saw that error.

If one of the mods could edit the very first post where it mentions that, it would save everyone using this mod a lot of time smile

Thanx

Fazman


has arrived. Flight your way to heavenly pleasures.

Offline

 

#21 08-29-2010 06:08:16

dh783
Member
From: Avondale, Arizona
Registered: 04-06-2005
Posts: 6233
Website

Re: Mod::Dynamic FrontEnd Menu with 3 Sub-Categories Display.

Ok fixed the s problem it the original post.

John

Offline

 

#22 08-30-2010 00:28:17

Design_Wholesale
Member
From: England!
Registered: 11-21-2008
Posts: 1104
Website

Re: Mod::Dynamic FrontEnd Menu with 3 Sub-Categories Display.

If you have an error message like that shown below when browsing with IE check that you have an  somewhere in your  as the  for one of the elements on that page,  , or .

It should not matter whether you actually have any declared styles in your CSS file(s) or not and, if you have nothing that does not already have a  or  assigned to it with style information in the CSS file(s), there is no reason why you cannot simply clone the information for that  or , give it the name of  and then change the  or  identifier of whatever you chose to change in the  file. - Just remember that an  can only occur  on a page, as opposed to a , which can be used many times on the same page.

Code:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Timestamp: Mon, 30 Aug 2010 05:25:19 UTC


Message: 'document.getElementById(...)' is null or not an object
Line: 5
Char: 3
Code: 0
URI: http://litez.co.uk/skins/LDW/scripts/femenus.js

Last edited by Design_Wholesale (09-04-2010 18:38:33)

Offline

 

#23 09-04-2010 19:02:39

Design_Wholesale
Member
From: England!
Registered: 11-21-2008
Posts: 1104
Website

Re: Mod::Dynamic FrontEnd Menu with 3 Sub-Categories Display.

I am still finding the errors shown below in my debug that appear to be being triggered by this modification, though, and have not been able to identify why they are happening.

I have been over the instructions for implementing the modification several times and have made sure that everything matches up , but still the errors are occuring.  I would really appreciate it if someone could, at the very least, rule out the modification as the cause of these errors and hopefully point me in the direction of whatever else might be generating them.

Code:

KHXC_Error::error: Non-fatal error encountered: Undefined variable: sub2 File: /apps/gbu0/GBU/ext/femenus.php Line: 737

KHXC_Error::error: Non-fatal error encountered: Undefined variable: sub2 File: /apps/gbu0/GBU/ext/femenus.php Line: 737

KHXC_Error::error: Non-fatal error encountered: Undefined variable: sub2 File: /apps/gbu0/GBU/ext/femenus.php Line: 737

KHXC_Error::error: Non-fatal error encountered: Undefined variable: sub3 File: /apps/gbu0/GBU/ext/femenus.php Line: 715

KHXC_Error::error: Non-fatal error encountered: Undefined variable: sub3 File: /apps/gbu0/GBU/ext/femenus.php Line: 715

KHXC_Error::error: Non-fatal error encountered: Undefined variable: sub3 File: /apps/gbu0/GBU/ext/femenus.php Line: 715

KHXC_Error::error: Non-fatal error encountered: Undefined variable: sub3 File: /apps/gbu0/GBU/ext/femenus.php Line: 715

KHXC_Error::error: Non-fatal error encountered: Undefined variable: sub2 File: /apps/gbu0/GBU/ext/femenus.php Line: 737

KHXC_Error::error: Non-fatal error encountered: Undefined variable: sub2 File: /apps/gbu0/GBU/ext/femenus.php Line: 737

KHXC_Error::error: Non-fatal error encountered: Undefined variable: sub2 File: /apps/gbu0/GBU/ext/femenus.php Line: 737

KHXC_Error::error: Non-fatal error encountered: Undefined variable: sub2 File: /apps/gbu0/GBU/ext/femenus.php Line: 737

KHXC_Error::error: Non-fatal error encountered: Undefined variable: sub2 File: /apps/gbu0/GBU/ext/femenus.php Line: 737

KHXC_Error::error: Non-fatal error encountered: Undefined variable: sub1 File: /apps/gbu0/GBU/ext/femenus.php Line: 759

KHXC_Error::error: Non-fatal error encountered: Undefined variable: sub2 File: /apps/gbu0/GBU/ext/femenus.php Line: 737

KHXC_Error::error: Non-fatal error encountered: Undefined variable: sub2 File: /apps/gbu0/GBU/ext/femenus.php Line: 737

KHXC_Error::error: Non-fatal error encountered: Undefined variable: sub2 File: /apps/gbu0/GBU/ext/femenus.php Line: 737

KHXC_Error::error: Non-fatal error encountered: Undefined variable: sub2 File: /apps/gbu0/GBU/ext/femenus.php Line: 737

KHXC_Error::error: Non-fatal error encountered: Undefined variable: sub1 File: /apps/gbu0/GBU/ext/femenus.php Line: 759

KHXC_Error::error: Non-fatal error encountered: Undefined variable: sub1 File: /apps/gbu0/GBU/ext/femenus.php Line: 759

KHXC_Error::error: Non-fatal error encountered: Undefined variable: sub2 File: /apps/gbu0/GBU/ext/femenus.php Line: 737

KHXC_Error::error: Non-fatal error encountered: Undefined variable: sub1 File: /apps/gbu0/GBU/ext/femenus.php Line: 759

KHXC_Error::error: Non-fatal error encountered: Undefined variable: sub1 File: /apps/gbu0/GBU/ext/femenus.php Line: 759

Offline

 

#24 09-04-2010 20:41:46

dh783
Member
From: Avondale, Arizona
Registered: 04-06-2005
Posts: 6233
Website

Re: Mod::Dynamic FrontEnd Menu with 3 Sub-Categories Display.

Its coming from the unset command for sub2 or sub3 when it trying to build the array, I used unset to clear the last build of those arrays to get it ready  for the next pass thru, I have done some quick test with replacing those code lines with just a empty statement and it seem to work with out producing the error line in debug, so declare the three sub array just before the foreach statement

Code:

$sub1 = '';
$sub2 = '';
$sub3 = '';

foreach ($result as $num => $row) {

and then replace the unset commands

Code:

unset($sub3):

with

Code:

$sub3 = '';

and

Code:

unset($sub2);

with

Code:

$sub2 = '';

and

Code:

unset($xsub1);
unset($sub1);

with

Code:

$xsub1 = '';
$sub1 = '';

I have also corrected the first posting on this code above.

John

Last edited by dh783 (09-04-2010 22:27:27)

Offline

 

#25 09-05-2010 12:31:48

Design_Wholesale
Member
From: England!
Registered: 11-21-2008
Posts: 1104
Website

Re: Mod::Dynamic FrontEnd Menu with 3 Sub-Categories Display.

Thanks, John. - That just leaves me with two other items to deal with, neither of which are related to this modification.

Also, your modified code at the top of the page works better than the individual code edits, which left me with one unmodified unset reference and no third level subcategories smile ...

Last edited by Design_Wholesale (09-05-2010 12:55:08)

Offline

 

Board footer