Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2007
    Location
    San Antonio, TX
    Posts
    71
    Plugin Contributions
    0

    Default Different Logo for each category?

    It is possible to have the main logo changed for each product category?

    Index will have a logo, but if they go to category XX it has a different logo... category YY has a different logo... category ZZ has a logo, and so on...

    I am sure this is possible, but I dont know exactly where to start.

    Thanks!

    EDIT*** Clarification... this is for the logo of the main page... not the logo display for the category itself.
    Last edited by texasemt; 1 Jul 2016 at 09:23 PM. Reason: Clarification

  2. #2
    Join Date
    Apr 2007
    Location
    San Antonio, TX
    Posts
    71
    Plugin Contributions
    0

    Default Re: Different Logo for each category?

    I found smart backgrounds in the download section... I will start with that.

  3. #3
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Different Logo for each category?

    includes/your_template/common/tpl_header.php is (commonly) where the logo gets displayed.

    And $current_category_id is the number of the currently-selected category.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  4. #4
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: Different Logo for each category?

    Just a thought experiment on my part, but thinking if you work with a copy of includes/templates/template_default/common/tpl_header.php or more specifically includes/templates/YOUR_TEMPLATE/common/tpl_header.php then if you find this section:
    Code:
    <!--bof-branding display-->
    <div id="logoWrapper">
        <div id="logo"><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . zen_image($template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE, HEADER_ALT_TEXT) . '</a>'; ?></div>
    <?php if (HEADER_SALES_TEXT != '' || (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2))) { ?>
        <div id="taglineWrapper">
    <?php
    You could modify it to do some sort of lookup (new function?) to identify your desired image, or you could use a "crafted" version of the logo filename so that if the filename exists to use your file and if not then the default:

    Code:
    <!--bof-branding display-->
    <div id="logoWrapper">
        <div id="logo"><?php 
    if (file_exists($template->get_template_dir('logo-' . $current_category_id . '.' . pathinfo(HEADER_LOGO_IMAGE, PATHINFO_EXTENSION), DIR_WS_TEMPLATE, $current_page_base,'images') . '/' . 'logo-' . $current_category_id . '.' . pathinfo(HEADER_LOGO_IMAGE, PATHINFO_EXTENSION))) {
      $current_logo = $template->get_template_dir('logo-' . $current_category_id . '.' . pathinfo(HEADER_LOGO_IMAGE, PATHINFO_EXTENSION), DIR_WS_TEMPLATE, $current_page_base,'images') . '/' . 'logo-' . $current_category_id . '.' . pathinfo(HEADER_LOGO_IMAGE, PATHINFO_EXTENSION);
    } else {
      $current_logo = $template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE;
    }
    echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . zen_image($current_logo, HEADER_ALT_TEXT) . '</a>'; ?></div>
    <?php if (HEADER_SALES_TEXT != '' || (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2))) { ?>
        <div id="taglineWrapper">
    <?php
    Probably a lot of other ways to accomplish it and didn't look for a ZC related function to obtain the file extension, but the above should allow filenaming to be similar to the original logo (meaning same file extension) but with a relatively straight forward filename convention of 'logo-$current_category_id', or the standard header logo if the previous don't exist. The logo is expected to be saved in the template directory images folder as allowed through applicable overrides identified in includes/classes/template_func.php.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #5
    Join Date
    Apr 2007
    Location
    San Antonio, TX
    Posts
    71
    Plugin Contributions
    0

    Default Re: Different Logo for each category?

    Thanks everyone... I used the mod I found above and I got it working properly. There was a little code I had to edit because of the responsive template in 1.5.5a, but I posted that in the support forum for the mod.

    Thanks again!

 

 

Similar Threads

  1. Different header for each category
    By mdc in forum Templates, Stylesheets, Page Layout
    Replies: 12
    Last Post: 21 Jul 2010, 06:10 PM
  2. Different category box for each category
    By ebloger in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 12 Apr 2008, 08:16 AM
  3. New logo for each category
    By lorhan in forum General Questions
    Replies: 2
    Last Post: 2 Jan 2008, 08:48 PM

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