Forums / Templates, Stylesheets, Page Layout / featured sidebox image next to text.

featured sidebox image next to text.

Locked

Views: 1,305

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
17 Aug 2008, 6:58 PM
#1
ctcentralinfo avatar

ctcentralinfo

Totally Zenned

Join Date:
Apr 2005
Posts:
853
Plugin Contributions:
0

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

https://www.cooltechcentral.com

17 Aug 2008, 7:55 PM
#2
ctcentralinfo avatar

ctcentralinfo

Totally Zenned

Join Date:
Apr 2005
Posts:
853
Plugin Contributions:
0

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 - <https://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

https://www.cooltechcentral.com

18 Aug 2008, 2:57 AM
#3
ctcentralinfo avatar

ctcentralinfo

Totally Zenned

Join Date:
Apr 2005
Posts:
853
Plugin Contributions:
0

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

https://www.cooltechcentral.com