Results 1 to 10 of 63

Hybrid View

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

    Default Re: Display Categories In Separate Boxes

    No, you do not need to use the separate category mod for this. In fact, the layout you refer to, moreso than your current site state, is exactly what Categories Dressing was originally designed to do: add nice headings at desired places in the categories menu.

  2. #2
    Join Date
    May 2006
    Posts
    41
    Plugin Contributions
    0

    Default Re: Display Categories In Separate Boxes

    Quote Originally Posted by gjh42 View Post
    No, you do not need to use the separate category mod for this. In fact, the layout you refer to, moreso than your current site state, is exactly what Categories Dressing was originally designed to do: add nice headings at desired places in the categories menu.
    Okay fantastic, i will use the category dressing instead.

  3. #3
    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...

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

    Default Re: Display Categories In Separate Boxes

    Will this work with 1.5?

  5. #5
    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.

  6. #6
    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...

  7. #7
    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...

 

 

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