+ Reply to Thread
Results 1 to 7 of 7

Thread: Customizing Sub-Categories to show image instead of text

  1. #1
    Client
    Join Date
    Jul 2007
    Posts
    12
    Squirrelcart version
    not specified!

    Customizing Sub-Categories to show image instead of text

    Hello...
    I've searched the forum and found many answers to my questions, but unless I've somehow missed it in here or the template editing docs, I can't seem to change the subcategory image. I'd like to be able to show an 'Image Name' as opposed to just text in the subcategory main content section. I've attached an image to help clarify.

    Thanks in advance.

    -niko
    Attached Images

  2. #2
    Squirrelcart Staff Jamie's Avatar
    Join Date
    May 2002
    Posts
    6,719
    Squirrelcart version
    v3.3.7
    Hi Niko,

    You can do that by changing the subcategory_detail_single.tpl.php template file. Change this:
    PHP Code:
    <a href="<?=$Open_Category_HREF?>"><?=$Name?></a>
    To this:
    PHP Code:
    <a href="<?=$Open_Category_HREF?>"><?=$Image_of_Name?></a>

  3. #3
    Squirrelcart Staff Jamie's Avatar
    Join Date
    May 2002
    Posts
    6,719
    Squirrelcart version
    v3.3.7
    Follow up:

    For those wanting to show an image for subcategories using the Image field instead of the Image of Name field, open the subcategory_detail_single.tpl.php template file in an editor and change this:

    PHP Code:
    <a href="<?=$Open_Category_HREF?>"><?=$Name?></a>
    to this:
    PHP Code:
    <a href="<?=$Open_Category_HREF?>"><?=$Image?></a>


  4. #4
    Client
    Join Date
    Jan 2007
    Posts
    12
    Squirrelcart version
    not specified!
    Jamie,
    IS there an update on this for the new setup? I have looked through the forums and did not see anything...

    Existing code in category.tpl.php

    <!-- Section below handles showing subcategories if enabled -->
    <?php if ($Subcategory_Rows): ?>
    <div class="subcategories">
    <?php foreach($Subcategory_Rows as $Subcategory_Row): ?>
    <div class="box_row <?php print $Subcategory_Row['instance']?>">
    <?php foreach($Subcategory_Row['categories'] as $Subcategory): ?>
    <div class="box_outer <?php print $Subcategory['instance'].' '.$Subcategory['box_width_class'] ?>">
    <div class="box_inner">
    <?php print $Subcategory['HTML'] ?>
    </div>
    </div>
    <?php endforeach; ?>
    </div>
    <?php endforeach; ?>
    </div>
    <?php endif;?>

    Dave

  5. #5
    Squirrelcart Staff Jamie's Avatar
    Join Date
    May 2002
    Posts
    6,719
    Squirrelcart version
    v3.3.7

  6. #6
    Client SketchWork's Avatar
    Join Date
    Aug 2007
    Posts
    79
    Squirrelcart version
    v3.3.2

    Question

    Hi Jamie,

    This TPL file has changed now. What would the the way to have sub categories show the "name of image" in the current version?

    Many thanks,

    Justin

  7. #7
    Squirrelcart Staff Jamie's Avatar
    Join Date
    May 2002
    Posts
    6,719
    Squirrelcart version
    v3.3.7
    Hi Justin,

    Post #5 in the thread I linked to in my last reply above should work for the new version.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts