Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2008
    Location
    Illinois
    Posts
    54
    Plugin Contributions
    0

    Default Display different image and link in sidebox depending on category displayed

    I was wondering if there is a way I could control what image and link is displayed in a sidebox depending on what category is currently being displayed.

    Example:

    If Category 1 is being displayed
    display image1.jpg and link1.jpg

    If Category 2 is being displayed
    display image2.jpg and link2.jpg

    etc.

  2. #2
    Join Date
    Feb 2008
    Location
    Illinois
    Posts
    54
    Plugin Contributions
    0

    Default Re: Display different image and link in sidebox depending on category displayed

    Ok.. figured it out... I created a sidebox file in the
    includes/modules/sideboxes/ directory called sub.php ...

    and added the following code into the php file:

    <?php

    if ($cPath == '7') {
    $content='<div style="margin-top:8px;"><a href="http://www. sub 1 .com "><img src="includes/templates/links/images/sub3.jpg" /></a></div>';
    echo $content;

    }
    else if ($cPath == '4') {
    $content='<div style="margin-top:8px;"><a href="https://www. sub 2.com"><img src="includes/templates/links/images/sub1.jpg" /></a></div>';
    echo $content;

    }else {

    $content='<div style="margin-top:8px;"><a href="https://www. other .com"><img src="includes/templates/links/images/sub2.jpg" /></a></div>';
    echo $content;

    }

    ?>

    This changes the sidebox image and link depending on the category that is being displayed... kind of like a sponsor image/link changer that is associated with the category/products.

 

 

Similar Threads

  1. Different number of categories shown depending on category level
    By creff in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 21 Aug 2014, 06:28 PM
  2. Replies: 1
    Last Post: 16 Nov 2012, 10:31 PM
  3. Different category image and product image
    By audiomandan in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 31 Mar 2011, 08:55 AM
  4. Display Category and Sub Category... old link doesnt work anymore
    By DirkDiggler in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 10 Feb 2007, 09:26 PM
  5. CSS Fly Out sidebox or at least display category link as block on mouseover ?
    By styrax in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 5 Dec 2006, 12:32 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