Results 1 to 10 of 63

Hybrid View

  1. #1
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,835
    Plugin Contributions
    31

    Default Re: Display Categories In Separate Boxes

    The current version 1.2 has a problem.

    It uses a variable $name which is unset after the routine..this unsets $name used in the contact us page to pre-populate the name field when a client is logged in.

    I suggest this change from
    PHP Code:
        while (!$categories_ap->EOF)  {
            
    $id $categories_ap->fields['categories_id'];
            
    $name $categories_ap->fields['categories_name'];
              
    $add_content .= '<li><a href="' zen_href_link(FILENAME_DEFAULT'&cPath='.$id) . '">'.$name.'</a></li>' "\n";
            
    $categories_ap->MoveNext();
        }
        
    $add_content .= '</ul>';
    //debug echo $add_content; 
        
    unset($name); 
    to
    PHP Code:
        while (!$categories_ap->EOF)  {
            
    $categories_id $categories_ap->fields['categories_id'];
        
    $categories_name $categories_ap->fields['categories_name'];
        
    $add_content .= '<li><a href="' zen_href_link(FILENAME_DEFAULT'&cPath='.$categories_id) . '"><span class="catSpan">'.$categories_name.'</span></a></li>' "\n";
        
    $categories_ap->MoveNext();
        }
        
    $add_content .= '</ul>';

    //echo $add_content;//debug to check query is ok 
        //unset($categories_name);//was $name but overwrote $name in contact_us 
    Steve
    github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

  2. #2
    Join Date
    Aug 2012
    Posts
    23
    Plugin Contributions
    0

    Default Re: Display Categories In Separate Boxes

    Will this work with 1.5?

  3. #3
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Display Categories In Separate Boxes

    It probably will. The files and systems involved are not ones that changed for v1.5.x.

  4. #4
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,835
    Plugin Contributions
    31

    Default cPath incomplete

    I've just noticed that the array that gets used for this produces an incomplete cPath.
    ie if your parent id is 2 and the category is 345, the link goes to 345 instead of 2_345 which will result in incomplete breadcrumbs.

    This is how I fixed it:
    in \includes\modules\sideboxes\YOUR_TEMPLATE\separate_category_sidebox.php

    change
    PHP Code:
    while (!$categories_ap->EOF)  {
            
    $id $categories_ap->fields['categories_id'];
            
    $name $categories_ap->fields['categories_name'];
            
    $add_content .= '<li><a href="' zen_href_link(FILENAME_DEFAULT'&cPath='.$id) . '">'.$name.'</a></li>' "\n";
            
    $categories_ap->MoveNext();
        } 
    to
    PHP Code:
        while (!$categories_ap->EOF)  {
            
    $categories_path zen_get_path($categories_ap->fields['categories_id']);
            
    $categories_name $categories_ap->fields['categories_name'];
            
    $add_content .= '<li><a href="' zen_href_link(FILENAME_DEFAULT'&'.$categories_path) . '"><span class="catSpan">'.$categories_name.'</span></a></li>' "\n";
            
    $categories_ap->MoveNext();
        } 
    Note I have also changed the variable names for clarity and added a css class to the link.
    Steve
    github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

  5. #5
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,835
    Plugin Contributions
    31

    Default Re: cPath incomplete

    I need to eat the previous post, the "fix" worked at the time but not later, this appears to work consistently:

    PHP Code:
    while (!$categories_ap->EOF)  {
            
    $categories_path zen_get_generated_category_path_rev($categories_ap->fields['categories_id']);//debug echo '$categories_path='.$categories_path.'<br />';
            
    $categories_name $categories_ap->fields['categories_name'];
            
    $add_content .= '<li><a href="' zen_href_link(FILENAME_DEFAULT'&cPath='.$categories_path) . '"><span class="catSpan">'.$categories_name.'</span></a></li>' "\n";
            
    $categories_ap->MoveNext();
        } 
    Steve
    github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

  6. #6
    Join Date
    Feb 2009
    Posts
    32
    Plugin Contributions
    0

    Default Re: cPath incomplete

    Hello,

    I'm building my site and I'm using this mod on my site, but the side-box looks very different to my other template side-box, can someone put me in the right direction to show the information like the other templates side-box.


    Here is my site
    Code:
    http://compuservicesj.com/store/
    Thanks
    Jose

  7. #7
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: cPath incomplete

    Add to your stylesheet
    Code:
    .separatesideboxlist>li {margin-left: -3em; list-style: inside url(../images/bc_info.gif);line-height: 2.0em; border-bottom: 1px dashed #aabbcc;}

 

 

Similar Threads

  1. v151 2 Separate Boxes on Different Category Type
    By PanZC2020 in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 18 Aug 2016, 09:40 PM
  2. Separate quantity boxes for different attributes
    By ::AnanA:: in forum Setting Up Categories, Products, Attributes
    Replies: 6
    Last Post: 7 Oct 2008, 02:21 PM
  3. Separate Top Categories from Sub-Categories in Layout?
    By msmith29063 in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 22 Feb 2008, 06:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg