Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2007
    Location
    Ontario, Canada
    Posts
    1,731
    Plugin Contributions
    27

    Idea or Suggestion Twitch Category List Image Control Switch

    Method to control category image display on index or main page display for 1.56c (Twitch Base6)

    There are other controls for these images however none control the display when includes/modules/YOUR_TEMPLATE/category_row.php is being used... until now!

    Twitch - Show Index Category Image?
    0 = OFF No Image Shown - Use CSS Button
    1 = ON Show Image - Text (default)


    Backup your database and your fileset before installing this little switch. Understand that your template may be different and you can adjust the CSS to match the sizes/colours you may prefer.


    Twitch Category List Image Control Switch
    # SQL Update - new switch
    INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES ('Twitch - Show Index Category Image?', 'TWI_INDEX_CATEGORY_IMAGE_SWI', '1', '0 = OFF No Image Shown - Use CSS Button <br />1 = ON Show Image - Text (default)', 8, 120, now(), NULL, 'zen_cfg_select_option(array(''0'', ''1''), ');


    # Uninstall Only
    DELETE FROM configuration WHERE configuration_key in ('TWI_INDEX_CATEGORY_IMAGE_SWI');
    # Uninstall Only


    includes/modules/YOUR_TEMPLATE/category_row.php
    replace this:
    $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_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br />' . $categories->fields['categories_name'] . '</a>');

    with this:
    if (TWI_INDEX_CATEGORY_IMAGE_SWI != 0 ) { // bof Twitch Category List Image Control Switch
    $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_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br />' . $categories->fields['categories_name'] . '</a>');
    } else { // do not show category image
    $list_box_contents[$row][$col] = array('params' => 'class="categoryListBoxContentsButton"' . ' ' . 'style="width:' . $col_width . '%;"',
    'text' => '<a href="' . zen_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . $categories->fields['categories_name'] . '</a>');
    } // eof Twitch Category List Image Control Switch



    includes/templates/YOUR_TEMPLATE/templates/css/stylesheet.css
    replace this:
    /*bof categories and product listing*/
    #productListHeading, #indexCategoriesHeading{font-weight:normal;margin-bottom:.5em;}
    #indexCategories {text-align: center; margin: 0 auto; width: 98%;} /* Twitch center the index category images */
    .categoryListBoxContents img {/*margin-bottom:1em;*/}
    .categoryListBoxContents a{font-size:1.2em;text-decoration:none;font-weight:bold;border: solid 2px #356536;}
    .categoryListBoxContents a:hover{}
    .categoryListBoxContents{padding:1em 0;display:inline-block;cursor:pointer;}
    .categoryListBoxContents:hover{}
    .categoryListBoxContents:hover a{}


    with this:
    /*bof categories and product listing*/
    #productListHeading, #indexCategoriesHeading{font-weight:normal;margin-bottom:.5em;}
    #indexCategories {text-align: center; margin: 0 auto; width: 98%;} /* Twitch center the index category images */
    .categoryListBoxContents img {/*margin-bottom:1em;*/}
    .categoryListBoxContents a{font-size:1.2em;text-decoration:none;font-weight:bold;}
    .categoryListBoxContents a:hover{}
    .categoryListBoxContents{padding:1em 0;display:inline-block;cursor:pointer;}
    .categoryListBoxContents:hover{}
    .categoryListBoxContents:hover a{}
    /* Twitch Category List Image Control Switch */
    .categoryListBoxContentsButton a {font-size:1.2em;text-decoration:none;font-weight:bold;border: solid 2px #356536;padding: 1em .5em;}
    .categoryListBoxContentsButton {padding:1em 0;display:inline-block;cursor:pointer;}



    includes/templates/YOUR_TEMPLATE/templates/css/stylesheet_colors.css
    replace this:
    /* Twitch CSS changes */
    .productSpecialPrice, .productSalePrice, .productSpecialPriceSale, .productPriceDiscount {color:#8b0000;}
    .categoryListBoxContents:hover {/* border: solid thin #AE9A80; */}
    .categoryListBoxContents a:hover, .categoryListBoxContents:hover a{color:#000;}


    with this:
    /* Twitch CSS changes */
    .productSpecialPrice, .productSalePrice, .productSpecialPriceSale, .productPriceDiscount {color:#8b0000;}
    .categoryListBoxContents:hover {/* border: solid thin #AE9A80; */}
    .categoryListBoxContents a:hover, .categoryListBoxContents:hover a{color:#000;}
    /* Twitch Category List Image Control Switch */
    .categoryListBoxContentsButton a:hover, .categoryListBoxContentsButton:hover a {color:#FFF;background: #356536;}


    Keywords: turn off category image, index category image off, categories css buttons, categories image off


    If my work has helped you today in any way, show your appreciation with things like positive feedback or donations.
    Find me at twitchtoo.com.
    Twitch.
    https://www.twitchtoo.com Do you work for free? Please donate.
    Twitch Base8 - Obsidian - This, is what's new.

  2. #2
    Join Date
    Apr 2007
    Location
    Ontario, Canada
    Posts
    1,731
    Plugin Contributions
    27

    Default Re: Twitch Category List Image Control Switch

    Slight update for anyone having CSS button overlap issues:

    includes/modules/YOUR_TEMPLATE/category_row.php

    replace this:
    if (TWI_INDEX_CATEGORY_IMAGE_SWI != 0 ) { // bof Twitch Category List Image Control Switch
    $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_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br />' . $categories->fields['categories_name'] . '</a>');
    } else { // do not show category image
    $list_box_contents[$row][$col] = array('params' => 'class="categoryListBoxContentsButton"' . ' ' . 'style="width:' . $col_width . '%;"',
    'text' => '<a href="' . zen_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . $categories->fields['categories_name'] . '</a>');
    } // eof Twitch Category List Image Control Switch


    with this:
    if (TWI_INDEX_CATEGORY_IMAGE_SWI != 0 ) { // bof Twitch Category List Image Control Switch
    $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_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br />' . $categories->fields['categories_name'] . '</a>');
    } else { // do not show category image
    $list_box_contents[$row][$col] = array('params' => 'class="categoryListBoxContentsButton"' . ' ',
    'text' => '<a href="' . zen_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . $categories->fields['categories_name'] . '</a>');
    } // eof Twitch Category List Image Control Switch


    Add a bit more space between the buttons...
    includes/templates/YOUR_TEMPLATE/templates/css/stylesheet.css

    .categoryListBoxContentsButton {margin: .5em;padding:1em 0;display:inline-block;cursorointer;}
    Twitch.
    https://www.twitchtoo.com Do you work for free? Please donate.
    Twitch Base8 - Obsidian - This, is what's new.

 

 

Similar Threads

  1. v151 Twitch List Price - how do I display List price?
    By Trinity14 in forum Templates, Stylesheets, Page Layout
    Replies: 20
    Last Post: 19 Jul 2021, 08:17 PM
  2. Twitch Wholesale | Retail Product Control Switch
    By twitchtoo in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 20 Oct 2018, 08:09 PM
  3. Control Switch
    By jsarwar in forum Customization from the Admin
    Replies: 2
    Last Post: 15 Jun 2017, 01:56 AM
  4. v151 Twitch Product Image Magnifier
    By twitchtoo in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 8 Mar 2014, 02:29 AM
  5. Twitch Hide Any Category
    By twitchtoo in forum Addon Sideboxes
    Replies: 9
    Last Post: 6 Aug 2013, 05:19 AM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR