Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2007
    Posts
    35
    Plugin Contributions
    0

    Default Only certain categories go on the main page?

    Ok, I get how to make all the categories show on the main page, and I get how to make none of them show... But how do I make only SOME show in the mainpage (while all remain in the sidebox)?

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Only certain categories go on the main page?

    What is the link to your site to see what you have?

  3. #3
    Join Date
    Nov 2007
    Posts
    35
    Plugin Contributions
    0

    Default Re: Only certain categories go on the main page?

    www.fetchingdogcollars.com/wholesale

    I want the 4 collar categories (3/4, 1, 1.5, and 2-inch) to remain on the main page AND the sidebox, but the leashes to only be in the sidebox.

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

    Default Re: Only certain categories go on the main page?

    You can suppress display of a certain category in that page by editing
    /includes/modules/your_template/category_row.php. Find this section:
    PHP Code:
        // strip out 0_ from top level cats
        
    $cPath_new str_replace('=0_''='$cPath_new);

        
    //    $categories->fields['products_name'] = zen_get_products_name($categories->fields['products_id']);

        
    $list_box_contents[$row][$col] = array('params' => 'class="categoryListBoxContents"' ' ' 'style="width:' $col_width '%;"',
                                               
    'text' => '<a href="' zen_href_link(FILENAME_DEFAULT$cPath_new) . '">' zen_image(DIR_WS_IMAGES $categories->fields['categories_image'], $categories->fields['categories_name'], SUBCATEGORY_IMAGE_WIDTHSUBCATEGORY_IMAGE_HEIGHT) . '<br />' $categories->fields['categories_name'] . '</a>');

        
    $col ++;
        if (
    $col > (MAX_DISPLAY_CATEGORIES_PER_ROW -1)) {
          
    $col 0;
          
    $row ++;
        }
        
    $categories->MoveNext();
      }
    }
    ?> 
    and add a test for category 7:
    PHP Code:
        // strip out 0_ from top level cats
        
    $cPath_new str_replace('=0_''='$cPath_new);

        
    //    $categories->fields['products_name'] = zen_get_products_name($categories->fields['products_id']);
        
    if ((int)$cPath_new !=7) { //display all but cat 7
        
    $list_box_contents[$row][$col] = array('params' => 'class="categoryListBoxContents"' ' ' 'style="width:' $col_width '%;"',
                                               
    'text' => '<a href="' zen_href_link(FILENAME_DEFAULT$cPath_new) . '">' zen_image(DIR_WS_IMAGES $categories->fields['categories_image'], $categories->fields['categories_name'], SUBCATEGORY_IMAGE_WIDTHSUBCATEGORY_IMAGE_HEIGHT) . '<br />' $categories->fields['categories_name'] . '</a>');

        
    $col ++;
        } 
    //display all but cat 7
        
    if ($col > (MAX_DISPLAY_CATEGORIES_PER_ROW -1)) {
          
    $col 0;
          
    $row ++;
        }
        
    $categories->MoveNext();
      }
    }
    ?> 

  5. #5
    Join Date
    Nov 2007
    Posts
    35
    Plugin Contributions
    0

    Default Re: Only certain categories go on the main page?

    Ok, I must be missing something. I put the new code in and nothing happened....

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

    Default Re: Only certain categories go on the main page?

    Add a debug line to make sure the test is accurate:

    echo 'top cat id: ' . (int)$cPath_new; //debug
    if ((int)$cPath_new !=7) { //display all but cat 7

    Nevermind, the $cPath_new variable is going to be something like
    cPath=7
    which will never evaluate to just 7.
    Change the line to

    if ((int)str_replace('cPath=', '', $cPath_new) != 7) { //display all but cat 7
    Last edited by gjh42; 6 Oct 2008 at 01:15 AM.

 

 

Similar Threads

  1. v139h Can I let only certain customers into certain categories?
    By wiccan0974 in forum General Questions
    Replies: 2
    Last Post: 21 Feb 2012, 03:53 PM
  2. sub categories only on main page
    By Phil020782 in forum Setting Up Categories, Products, Attributes
    Replies: 4
    Last Post: 5 Oct 2009, 03:19 PM
  3. Can I allow certain users to have access to only certain categories?
    By bparker in forum Customization from the Admin
    Replies: 2
    Last Post: 8 Sep 2009, 08:41 PM
  4. Show only Certain Products on Main Page
    By jmelwak in forum Setting Up Categories, Products, Attributes
    Replies: 4
    Last Post: 24 Jul 2007, 03:32 AM
  5. Highlighting certain categories on home page only
    By maxilious in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 14 Jun 2007, 08:35 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