Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    Jun 2006
    Posts
    13
    Plugin Contributions
    0

    Category sidebox shows category image

    Hi, i am new using ZC for 2wks, and now I want to change the default category name to show the category image on the sidebox, any one can help?

  2. #2
    Join Date
    Jan 2007
    Location
    Kansas City
    Posts
    8
    Plugin Contributions
    0

    Default Re: Category sidebox shows category image

    Found your post while searching for an answer to the same thing. No one seemed to know so I set out to solve it myself. And... I did!

    Fairly simple.

    File to edit:
    includes/templates/YOUR_TEMPLATE/sideboxes/tpl_categories.php

    **Please read up on the template override system. You will need to get the file from 'includes/templates/template_default/sideboxes/tpl_categories.php' first, then save in YOUR_TEMPLATE folder.

    Images to Create:
    images/menu-YourCategoryName.jpg

    images/menu-Blank.jpg

    ######################################################################____

    STEP 1
    Find:
    [FONT=Courier New]$content .= '<a class="' . $new_style . '" href="' . zen_href_link(FILENAME_DEFAULT, $box_categories_array[$i]['path']) . '">';[/FONT]
    [FONT=Courier New][FONT=Verdana](Line 34)


    STEP 2
    Just after that add:
    [/FONT][/FONT]
    [FONT=Courier New][FONT=Verdana][FONT=Courier New]// for adding image beside category name[/FONT][/FONT][/FONT]
    [FONT=Courier New][FONT=Verdana][FONT=Courier New]$myCategoryName = $box_categories_array[$i]['name'];[/FONT][/FONT][/FONT]
    [FONT=Courier New][FONT=Verdana][FONT=Courier New]if (file_exists('images/menu' . $myCategoryName . '.jpg')) {[/FONT][/FONT][/FONT]
    [FONT=Courier New][FONT=Verdana][FONT=Courier New] $content .= '<img src="images/menu-' . $myCategoryName . '.jpg" border="0" alt="YOUR ALT TEXT ' . $myCategoryName . '" align="absmiddle" />&nbsp;';[/FONT][/FONT][/FONT]
    [FONT=Courier New][FONT=Verdana][FONT=Courier New]} else {[/FONT][/FONT][/FONT]
    [FONT=Courier New][FONT=Verdana][FONT=Courier New] $content .= '<img src="images/menu-Blank.jpg" border="0" alt="HeatherDidIt! ' . $myCategoryName . '" align="absmiddle" />&nbsp;';[/FONT][/FONT][/FONT]
    [FONT=Courier New][FONT=Verdana][FONT=Courier New]}[/FONT][/FONT][/FONT]
    [FONT=Courier New][FONT=Verdana][FONT=Courier New]// end adding image code[/FONT][/FONT][/FONT]
    [FONT=Courier New][FONT=Verdana][FONT=Courier New]
    [FONT=Verdana]That's It!

    Now all you have to do whenever you add a new category is put the image you want to show up beside the category name in the images folder named "[/FONT]
    [/FONT][/FONT][/FONT]
    menu-YourCategoryName.jpg[FONT=Courier New][FONT=Verdana][FONT=Courier New][FONT=Verdana]"
    *Be sure to create a blank same-sized image called "menu-Blank.jpg" also


    *******************************************
    IF YOU WANT TO USE THE MAIN CATEGORY IMAGE
    You might try putting in this:
    [/FONT]
    [/FONT][/FONT][/FONT]
    [FONT=Courier New][FONT=Verdana][FONT=Courier New][FONT=Verdana][FONT=Courier New]zen_image(DIR_WS_IMAGES . $categories_image, '', CATEGORY_ICON_IMAGE_WIDTH, CATEGORY_ICON_IMAGE_HEIGHT);[/FONT][/FONT][/FONT][/FONT][/FONT]
    [FONT=Courier New][FONT=Verdana][FONT=Courier New][FONT=Verdana][FONT=Courier New][FONT=Verdana]Where the <img> tag is above.
    *******************************************

    Hope that helps.

    You can see my example here: http://www.heatherdidit.com
    [/FONT]
    [/FONT][/FONT]
    [/FONT][/FONT][/FONT]

  3. #3
    Join Date
    Apr 2006
    Location
    Kansas
    Posts
    236
    Plugin Contributions
    0

    Default Re: Category sidebox shows category image

    that is very nifty looking...

    ty.
    G Clef Jewelry
    Dichroic and Beaded Jewelry

  4. #4
    Join Date
    Jan 2007
    Posts
    1
    Plugin Contributions
    0

    Default Re: Category sidebox shows category image

    This is a cool little feature, thanks for the info, what I am wondering is.....
    How could you use an image rolllover for the catagory text instead. so then
    all the text catagory menus in the left main sidebox would be what ever jpeg image you define..

    anyidea, I have not come close to finding out this any leads would be great


    -mrbob

  5. #5
    Join Date
    Jan 2007
    Location
    Kansas City
    Posts
    8
    Plugin Contributions
    0

    Default Category Sidebox Shows Category Main Image

    Ok, so I found a better way to do it.

    This new method automatically changes the image beside the category link in the sidebox to what you have set as the main category image (Great for clients that want to update their own page).

    It's all in the file:
    includes/templates/MY_TEMPLATE/sideboxes/tpl_categories.php
    (Uses Template Override System. You may need to open the same file from the template_default folder and resave in your custom template folder.)

    Find (near line 34):
    [FONT=Courier New]$content .= '<a class="' . $new_style . '" href="' . zen_href_link(FILENAME_DEFAULT, $box_categories_array[$i]['path']) . '">';

    [/FONT]
    After that, add:

    [FONT=Courier New]// for adding image beside category name[/FONT]
    [FONT=Courier New][/FONT]
    [FONT=Courier New]// categories_image [/FONT]
    [FONT=Courier New]$categorySelect = str_replace('cPath=','',$box_categories_array[$i]['path']);[/FONT]
    [FONT=Courier New]$categories_image = zen_get_categories_image($categorySelect);[/FONT]
    [FONT=Courier New]$myCategoryImage = zen_image(DIR_WS_IMAGES . $categories_image, '', '50', '75');[/FONT]
    [FONT=Courier New]// categories_image[/FONT]
    [FONT=Courier New][/FONT]
    [FONT=Courier New]$content .= $myCategoryImage;[/FONT]
    [FONT=Courier New][/FONT]
    [FONT=Courier New]// end adding image code

    [/FONT]
    **Notice the '50'. You can replace this with your number of choice to set the width of the sidebox category image. And/Or put a number in place of the '75' to set the height of the sidebox category image. Or set either to '' and the images orginal sizes will be used. You can also set one to a number and the other to '' if you just need to set one dimension and you want the image dimensions kept in tact.
    Last edited by StylefireMedia; 13 Mar 2007 at 08:02 AM. Reason: Clarification

  6. #6

    Default Re: Category sidebox shows category image

    Quote Originally Posted by mrbob View Post
    This is a cool little feature, thanks for the info, what I am wondering is.....
    How could you use an image rolllover for the catagory text instead. so then
    all the text catagory menus in the left main sidebox would be what ever jpeg image you define..

    anyidea, I have not come close to finding out this any leads would be great


    -mrbob
    I'm new to ZenCart -- just using it for a few days now. I'd like to use JPGs for the sidebox category links instead of text. Would this work here, and maybe set the text in the CSS to be transparent or something (so the text would still differentiate the categories, but not show up)? A better way? Here's the site I'm working on. I've replaced the text in the footer with rollover images, but want to do something similar on the right sidebox. Help? http://theveryimage.com/zencart/

  7. #7
    Join Date
    Feb 2007
    Posts
    159
    Plugin Contributions
    0

    Default Re: Category sidebox shows category image

    http://theveryimage.com/zencart/

    Too cool. I love the way your background graphic covers the entire leftside. How did you do that?

    Beth-Katherine

  8. #8

    Default Re: Category sidebox shows category image

    Well, thank you! I set the background-image in the body specs of the stylesheet.css, and set the background-repeat to no-repeat. I also set a background-color, so if the screen is large than the image, it shows up on the right as the background color and blends well.
    Now if I could just get the sidemenu to work! I'm trying to adjust some setup information I found in the download section, but no joy yet.

  9. #9

    Default Re: Category sidebox shows category image

    In case anyone was following this thread and wanted to know how it turned out, I got the roll-over sidemenu to work with images and links to categories by using the Blank Sidebox from the Sideboxes section of the Downloads page.

    Granted, I am a beginner at coding, but for me it was very difficult to follow the directions in the readme -- I think some of it wasn't just me, it's a little mixed up. The main issue I noticed was that there was no mention of how to add links for the category pages in tpl_categories_sidebox.php. I found that info on the help page "How do EZ-Pages work?" under the heading "Internal Link URL".
    But it does work!

    (Note: I did already have some jscript in place for the mouseover stuff to swap images.)

  10. #10
    Join Date
    Feb 2007
    Posts
    159
    Plugin Contributions
    0

    Default Re: Category sidebox shows category image

    Awesome, you are my hero.

    and here I have been feeling proud getting rid of the annoying whitespace between my header and logo!

    I will be watching to see your products, if they are anything like your graphics I'll be buying soon.

    Beth-Katherine

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v151 Easy Populate shows main category but not linked category
    By yogeshvara in forum General Questions
    Replies: 5
    Last Post: 19 May 2014, 03:58 PM
  2. Image shows in category listing, but not in all Product Listings
    By wiccan0974 in forum General Questions
    Replies: 1
    Last Post: 26 Nov 2010, 06:02 AM
  3. Category name shows under sidebox image
    By tcooptx in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 8 Oct 2009, 07:46 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