Results 1 to 3 of 3
  1. #1

    Default featured sidebox image next to text.

    I am trying to figure out how to get the text for my featured sidebox next to the image instead of the text being under the image. I want to get a look similar to my best sellers sidebox:

    http://cooltechcentral.com.whsites.net/

    I tried to use my best sellers template file as an example but whenever I try to apply the same code I end up breaking up my site. I realize I will need to create tables but I can't figure out how to add them without messing up the site. Can anyone help me out? Thanks in advanced.
    Rich People scream, Wealthy people whisper

    www.cooltechcentral.com

  2. #2

    Default Re: featured sidebox image next to text.

    This is the tpl_featured.php sidebox file:

    <?php
    /**
    * Side Box Template
    *
    * @package templateSystem
    * @copyright Copyright 2003-2007 Zen Cart Development Team
    * @copyright Portions Copyright 2003 osCommerce
    * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
    * @version $Id: tpl_featured.php 6128 2007-04-08 04:53:32Z birdbrain $
    */
    $content = "";
    $content .= '<div class="sideBoxBorder">';
    $featured_box_counter = 0;
    while (!$random_featured_product->EOF) {
    $featured_box_counter++;
    $featured_box_price = zen_get_products_display_price($random_featured_product->fields['products_id']);

    $content .= '<div class="featuredSideboxContent">';
    $content .= '<a href="' . zen_href_link(zen_get_info_page($random_featured_product->fields["products_id"]), 'cPath=' . zen_get_generated_category_path_rev($random_featured_product->fields["master_categories_id"]) . '&products_id=' . $random_featured_product->fields["products_id"]) . '">' . zen_image(DIR_WS_IMAGES . $random_featured_product->fields['products_image'], $random_featured_product->fields['products_name'], SMALL_IMAGE_WIDTH/2, SMALL_IMAGE_HEIGHT/2, ' hspace="0" vspace="0" align="left"');
    $content .= '<br />' . $random_featured_product->fields['products_name'] . '</a>';
    $content .= '<br class="clearBoth" />';
    $content .= '</div>';
    $random_featured_product->MoveNextRandom();

    }
    $content .= '</div>';
    ?>
    and this is the tpl_best_seller.php file:
    <?php
    /**
    * Side Box Template
    *
    * @package templateSystem
    * @copyright Copyright 2003-2005 Zen Cart Development Team
    * @copyright Portions Copyright 2003 osCommerce
    * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
    * @version $Id: tpl_best_sellers.php 2982 2006-02-07 07:56:41Z birdbrain $
    * @version $Id: tpl_best_sellers.php 2982 2007-12-15 21:00:00 TRUST IT - www.trustit.ca - [email protected] $
    */
    $content = '';
    $content .= '<div class="bestsellersideBoxBorder">';
    $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent"><br>' . "\n";
    $content .= '<div class="wrapper"><table cellpadding=0 cellspacing=0 border=0>' . "\n";
    for ($i=1; $i<=sizeof($bestsellers_list); $i++) {
    $imgLink = DIR_WS_IMAGES . $bestsellers_list[$i]['image'];
    if ($i==2) {$content .= '<tr><td colspan=2><br><hr></td></tr>';}
    if ($i==3) {$content .= '<tr><td colspan=2><br><hr></td></tr>';}
    if ($i==4) {$content .= '<tr><td colspan=2><br><hr></td></tr>';}
    if ($i==5) {$content .= '<tr><td colspan=2><br><hr></td></tr>';}
    if ($i==6) {$content .= '<tr><td colspan=2><br><hr></td></tr>';}
    if ($i==7) {$content .= '<tr><td colspan=2><br><hr></td></tr>';}
    if ($i==8) {$content .= '<tr><td colspan=2><br><hr></td></tr>';}
    if ($i==9) {$content .= '<tr><td colspan=2><br><hr></td></tr>';}
    if ($i==10) {$content .= '<tr><td colspan=2><br><hr></td></tr>';}
    if ($i==11) {$content .= '<tr><td colspan=2><br><hr></td></tr>';}
    if ($i==12) {$content .= '<tr><td colspan=2><br><hr></td></tr>';}
    $content .= '<tr><td valign=top><a href="' . zen_href_link(zen_get_info_page($bestsellers_list[$i]['id']), 'products_id=' . $bestsellers_list[$i]['id']) . '">' . zen_image($imgLink, zen_trunc_string($bestsellers_list[$i]['name']), SMALL_IMAGE_WIDTH/2, SMALL_IMAGE_HEIGHT/2) . '</a></td><td valign=top><a href="' . zen_href_link(zen_get_info_page($bestsellers_list[$i]['id']), 'products_id=' . $bestsellers_list[$i]['id']) . '">' . zen_trunc_string($bestsellers_list[$i]['name'], BEST_SELLERS_TRUNCATE, BEST_SELLERS_TRUNCATE_MORE) . '</a><div align=left><b class="boldred">' . zen_get_products_display_price($bestsellers_list[$i]['id']) . '</div></td></tr>' . "\n";
    }
    $content .= '</table><br><hr><br></div>' . "\n";
    $content .= '</div>';
    $content .= '</div>';
    $content .= '</div>';
    ?>
    Rich People scream, Wealthy people whisper

    www.cooltechcentral.com

  3. #3

    Default Re: featured sidebox image next to text.

    I managed to get the image to aligh next to the text, but the title text is no longer a link:

    $content .= '<div class="featuredSideboxContent">';
    $content .= '<tr><td valign=top><a href="' . zen_href_link(zen_get_info_page($random_featured_product->fields["products_id"]), 'cPath=' . zen_get_generated_category_path_rev($random_featured_product->fields["master_categories_id"]) . '&products_id=' . $random_featured_product->fields["products_id"]) . '">' . zen_image(DIR_WS_IMAGES . $random_featured_product->fields['products_image'], $random_featured_product->fields['products_name'], SMALL_IMAGE_WIDTH/2, SMALL_IMAGE_HEIGHT/2, ' hspace="0" vspace="0" align="left"');
    $content .= '</td><td valign=top>' . $random_featured_product->fields['products_name'] . '</a></td></tr>';
    $content .= '<br class="clearBoth" />';
    $content .= '</div>';
    $random_featured_product->MoveNextRandom();

    }
    $content .= '</table><br><br></div>' . "\n";
    $content .= '</div>';
    ?>
    can anyone HELP?
    Rich People scream, Wealthy people whisper

    www.cooltechcentral.com

 

 

Similar Threads

  1. v154 strange text next to image
    By sadie in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 2 Dec 2015, 02:26 PM
  2. product text next to image
    By johnybravo in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 3 Oct 2011, 01:26 AM
  3. Featured Product Sidebox Image - Only used in sidebox?
    By adg_ in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 18 Mar 2010, 07:38 AM
  4. Use image next to Category in sidebox
    By charmedbytina2 in forum Basic Configuration
    Replies: 2
    Last Post: 11 Jun 2008, 05:24 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