Results 1 to 10 of 10
  1. #1
    Join Date
    Sep 2007
    Posts
    48
    Plugin Contributions
    0

    Default Banners specific to category

    for reference...www.fleurdepup.com/store *please note that we are still developing and have not yet set up payment options.

    If you notice on the main page, there is a gray box acting as a container for an image or .swf. It is not a banner through zencart's admin and is actually hard coded as a div into main_page.php. At the moment this image will show on every page.

    I wish to have a different image/.swf load here depending on where a user is on my site. So a specific image will load for the main page and another for each category, and so on.

    How would I go about doing this?

    Thanks for the help.

    Rich
    [FONT="Georgia"]Rich Staats
    Your snowboarding, web designing, problem solving, social networking, trying to f' with eCommerce type of Guy.[/FONT]

  2. #2
    Join Date
    Apr 2006
    Posts
    242
    Plugin Contributions
    0

    Default Re: Banners specific to category

    Have you tried replacing the gray image code with the flash code you have?

    The gray image shows up on every page for me, so all you would need to do is replace it right?

    EDIT: didn't notice the part you said about changing on select pages.

  3. #3
    Join Date
    Sep 2007
    Posts
    48
    Plugin Contributions
    0

    Default Re: Banners specific to category

    I think I might not have been clear.

    Right now, that gray box is just a placeholder jpg

    What I would like to accomplish is to have different images appear depending on what category the user is viewing.

    So on the main page I might have an image displaying a featured product and the image would link to that product's page.

    However if someone were to click on the category, fleur de Travel, an image displaying a visual of dog traveling products would appear.

    So on and so forth.

    So I think I need to write a conditional like,
    if category id=12 then show blahblah.jpg
    if category id=2 then show jibberjabber.jpg

    I just don't know how to do that.
    [FONT="Georgia"]Rich Staats
    Your snowboarding, web designing, problem solving, social networking, trying to f' with eCommerce type of Guy.[/FONT]

  4. #4
    Join Date
    Dec 2004
    Posts
    1,031
    Plugin Contributions
    0

    Default Re: Banners specific to category

    Just looked at your site and it looks to me that you figured out how to have a picture above the category title. I am trying the same thing. Could you please enlighten us how you did it?
    Live and learn... the Zen way.

  5. #5
    Join Date
    Dec 2007
    Posts
    19
    Plugin Contributions
    0

    Default Re: Banners specific to category

    Quote Originally Posted by mydanilo View Post
    Just looked at your site and it looks to me that you figured out how to have a picture above the category title. I am trying the same thing. Could you please enlighten us how you did it?
    You can make a banner for each category and point to it in your category description box instead of putting a category picture in :)

    Easy job, once you make the banners

    JoAnne

  6. #6
    Join Date
    Dec 2004
    Posts
    1,031
    Plugin Contributions
    0

    Default Re: Banners specific to category

    Quote Originally Posted by StarDancer View Post
    You can make a banner for each category and point to it in your category description box instead of putting a category picture in :)

    Easy job, once you make the banners

    JoAnne
    Do you mean put it just where it put the text for the category description? Wouldn't it be then below the category title? I want it to be above the category title just like fleurdepup here: http://fleurdepup.com/store/index.ph...ex&cPath=13_16.

    Maybe I need a bit more details how to do it.
    Live and learn... the Zen way.

  7. #7
    Join Date
    Dec 2004
    Posts
    1,031
    Plugin Contributions
    0

    Default Re: Banners specific to category

    Just following up on my problem. I tried what StarDancer suggested but the result is that the Title is still above my banner picture. You can see it here.
    http://www.mydanilo.com/index.php?ma...=index&cPath=7

    What I want is the Title below my picture. I want eventually on every category page a banner or call it header image above the title and of course it will be specific for each category.
    Here is another zen site that solved this beautifully:
    http://www.isabelharris.co.nz/shop/i...=index&cPath=5

    Can somebody tell me how to do this? Pleeeeese.
    Live and learn... the Zen way.

  8. #8
    Join Date
    Sep 2007
    Posts
    48
    Plugin Contributions
    0

    Default Re: Banners specific to category

    sorry for the delay....but basically I used the code from this post:

    http://www.zen-cart.com/forum/showthread.php?t=61790

    I wrapped that code in between <div id "catImage"> </div> which was placed appropriately on the main page file. If you want in the header, it would go in the header file, etc.

    let me know if this helps
    [FONT="Georgia"]Rich Staats
    Your snowboarding, web designing, problem solving, social networking, trying to f' with eCommerce type of Guy.[/FONT]

  9. #9
    Join Date
    Sep 2007
    Posts
    48
    Plugin Contributions
    0

    Default Re: Banners specific to category

    mydanilo:

    Try this:

    1. Find the file: tpl_main_page.php. Since you are planning on modifying this file, it is always best to put it into YOURTEMPLATE/common/tpl_main_page.php. I also have a file in this folder for tpl_header.php and tpl_footer.php

    2. Open tpl_main_page.php. scroll down to right below this piece of text:
    <!-- eof breadcrumb --> On the next line of code, I inserted all of this exactly for my site:


    PHP Code:
    <!-- bof  collection category image-->
    <?php
    if ($current_page_base == ("index" or "product_info"))
    {
    ?>
      <div id="collectionTitleImage"> <?php
      
      
    if (ereg("(^2$|^2_)",$cPath)) //fleur de spa
      

        echo 
    "<img src='" HTTP_SERVER DIR_WS_CATALOG "/images/spa.gif' alt='fleur de spa'>";
      }
      elseif (
    ereg("(^11$|^11_)",$cPath)) //fleur de sleep
      
    {
        echo 
    "<img src='" HTTP_SERVER DIR_WS_CATALOG "/images/sleep.gif' alt='fleur de sleep'>";
      }
      elseif (
    ereg("(^13$|^13_)",$cPath)) //fleur de travel
      
    {
        echo 
    "<img src='" HTTP_SERVER DIR_WS_CATALOG "/images/travel.gif' alt='fleur de travel'>";
      }
      elseif (
    ereg("(^6$|^6_)",$cPath)) //fleur de wear
      
    {
        echo 
    "<img src='" HTTP_SERVER DIR_WS_CATALOG "/images/top.gif' alt='fleur de wear'>";
      }
      elseif (
    ereg("(^9$|^9_)",$cPath)) //fleur de accessory
      
    {
        echo 
    "<img src='" HTTP_SERVER DIR_WS_CATALOG "/images/accessory.gif' alt='fleur de accessory'>";
      }
      elseif (
    $this_is_home_page//home page
    {
    echo 
    "<img src='" HTTP_SERVER DIR_WS_CATALOG "/images/index.gif' alt='Home Page'>";
    }
      
    ?>
      </div> <?php 
    ?>
    <!-- eof  collection category image -->
    I think this will answer your question. This code was originally given to me by the gjh42 from the post i linked previously so he dersvers all the credit.

    Later, and hope it works

    Rich
    [FONT="Georgia"]Rich Staats
    Your snowboarding, web designing, problem solving, social networking, trying to f' with eCommerce type of Guy.[/FONT]

  10. #10
    Join Date
    Dec 2004
    Posts
    1,031
    Plugin Contributions
    0

    Default Re: Banners specific to category

    Many thanks, I will give it a try.
    Live and learn... the Zen way.

 

 

Similar Threads

  1. Replies: 4
    Last Post: 23 Feb 2014, 09:39 PM
  2. Adding Banners to a Specific Page
    By Psykryph in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 17 Sep 2011, 03:22 AM
  3. Disable Banners On Specific Pages
    By PatF in forum Basic Configuration
    Replies: 3
    Last Post: 1 Sep 2011, 05:07 PM
  4. Banners or positions turned on / or of on specific pages
    By Fairstickers in forum Basic Configuration
    Replies: 0
    Last Post: 24 Mar 2009, 10:05 AM
  5. Product Page Specific Banners
    By jceci in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 21 Apr 2008, 09:51 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