Jump to content

A couple of layout questions


Guest

Recommended Posts

Okay, I seem to have the hang of most of the skin/template stuff, but there are a couple of things that I just cannot tweak quite how I want.

http://isolation13.com/store/index.php

In the "Latest Products" section, is there any way to put some space (padding?) between the text and the product images? Right now they jammed right against each other.

Is there also a way to make it so only 2 "latest products" show up, instead of 3?

Then, on this page:

http://isolation13.com/store/index.php?act=viewCat&catId=2

I can;t seem to move the "Move" button over to the left so it doesn't overlap the border. Where can I change this?

Any help would be GREATLY appreciated.

Thank you!

Link to comment
Share on other sites

You can have as many Latest Products showing as you want with this code:

In the includes/content/index.inc.php find this line:

for($i=0;$i<count($latestProducts);$i++){

Replace with this code

$across=4;

$index->assign("TW",100/$across);

for($i=0;$i<count($latestProducts);$i++){

if (!(($i+1) % $across)) {

$index->assign("TXT_TR","</tr><tr>");

} else {

$index->assign("TXT_TR","");

}

in skins/{insert skin name}/styleTemplates/content/index.tpl replace all code

between

<!-- BEGIN: repeat_prods -->

<!-- END: repeat_prods -->

including those two lines above with this code

<table width="100%" border="0"><tr>

<!-- BEGIN: repeat_prods -->

<td width="{TW}%">

<div style="float: center; text-align: center;">

<a href="index.php?act=viewProd&amp;productId={VAL_PRODUCT_ID}"><img src="{VAL_IMG_SRC}" alt="{VAL_PRODUCT_NAME}" border="0" /></a>

<br />

<a href="index.php?act=viewProd&amp;productId={VAL_PRODUCT_ID}" class="txtDefault">{VAL_PRODUCT_NAME}</a>

<br />

{TXT_PRICE} <span class="txtSale">{TXT_SALE_PRICE}</span>

</div>

</td>

{TXT_TR}

<!-- END: repeat_prods -->

</tr></table>

The $across variable is used to specify number products across.

When you say move the 'move' button I assume you mean the 'more' button. Your center column needs to be wider and is in layout.css

.colMid {

position: relative;

width: 398px;

float: left;

Link to comment
Share on other sites

Thanks Roban!

I only have one problem now.

You said that I could adjust the number of items showing up by changing the "$across" variable.

no matter what I change that number to, it just doesn't affect anything.

I have it set to "4" right now, but only 3 products show up. They are also all aligned to the center, each on their own row.

http://isolation13.com/store/index.php

I would like to set them up so there is 4 products, but 2 on each row.

I tried to fiddle around with the code where I thought it might make the changes, but no luck.

Any more help would be appreciated! Thanks!!

Link to comment
Share on other sites

Actually, I made it much bigger and they still put themselves on 3 sepeerate rows. I even made it as wide as 1000px, and though the box gets bigger the location of the products stays on 3 sepereate rows. I can't seem to figure it out.

Also, the $across variable doesn't seem to function at all for me. I have tried changing it to 2, 1, or even 0 and nothing ever changes. Do you have any idea what could be wrong with that?

Thanks again.

Link to comment
Share on other sites

I hope you're not putting the word CODE in there. It's in the code I posted but shouldn't be in there. I don't know M8, without seeing your files it's a stab in the dark but I think one of your problems is the length of your text. The whole ColMid will only accommodate 398 px (unless changed) so if you have more than that with 2 accross (including text) it'll bump to the next line. Try shortening your text and in admin/General Settings choose to display 4 products in latest Products.

Link to comment
Share on other sites

Sorry, I should have attached my code for you to see.

Here is my index.inc.php:

******************************************************

<?php

/*

+--------------------------------------------------------------------------

| CubeCart v3.0.3

| ========================================

| by Alistair Brookbanks

| CubeCart is a Trade Mark of Devellion Limited

| © 2005 Devellion Limited

| Devellion Limited,

| Westfield Lodge,

| Westland Green,

| Little Hadham,

| Nr Ware, HERTS.

| SG11 2AL

| UNITED KINGDOM

| http://www.devellion.com

| UK Private Limited Company No. 5323904

| ========================================

| Web: http://www.cubecart.com

| Date: Thursday, 22 September 2005

| Email: info (at) cubecart (dot) com

| License Type: CubeCart is NOT Open Source Software and Limitations Apply

| Licence Info: http://www.cubecart.com/site/faq/license.php

+--------------------------------------------------------------------------

| index.inc.php

| ========================================

| The Homepage :))

+--------------------------------------------------------------------------

*/

if(!isset($config)){

echo "<html>\r\n<head>\r\n<title>Forbidden 403</title>\r\n</head>\r\n<body><h3>Forbidden 403</h3>\r\nThe document you are requesting is forbidden.\r\n</body>\r\n</html>";

exit;

}

$index=new XTemplate ("skins/".$config['skinDir']."/styleTemplates/content/index.tpl");

include("language/".$lang_folder."/home.inc.php");

if($home['enabled']==0){

include("language/".$config['defaultLang']."/home.inc.php");

}

$index->assign("HOME_TITLE",stripslashes($home['title']));

$index->assign("HOME_CONTENT",stripslashes($home['copy']));

$latestProducts = $db->select("SELECT productId, image, price, name, sale_price FROM ".$glob['dbprefix']."CubeCart_inventory WHERE `showFeatured` = 1 ORDER BY productId DESC LIMIT ".$config['noLatestProds']);

if($config['showLatestProds']==1 && $latestProducts==TRUE){

$across=2;

$index->assign("TW",100/$across);

for($i=0;$i<count($latestProducts);$i++){

if (!(($i+1) % $across)) {

$index->assign("TXT_TR","</tr><tr>");

} else {

$index->assign("TXT_TR","");

}

if(($val = prodAltLang($latestProducts[$i]['productId'])) == TRUE){

$latestProducts[$i]['name'] = $val['name'];

}

if(file_exists($GLOBALS['rootDir']."/images/uploads/thumbs/thumb_".$latestProducts[$i]['image'])){

$index->assign("VAL_IMG_SRC",$GLOBALS['rootRel']."images/uploads/thumbs/thumb_".$latestProducts[$i]['image']);

} else {

$index->assign("VAL_IMG_SRC",$GLOBALS['rootRel']."skins/".$config['skinDir']."/styleImages/thumb_nophoto.gif");

}

$index->assign("LANG_LATEST_PRODUCTS",$lang['front']['index']['latest_products']);

if(salePrice($latestProducts[$i]['price'], $latestProducts[$i]['sale_price'])==FALSE){

$index->assign("TXT_PRICE",priceFormat($latestProducts[$i]['price']));

} else {

$index->assign("TXT_PRICE","<span class='txtOldPrice'>".priceFormat($latestProducts[$i]['price'])."</span>");

}

$salePrice = salePrice($latestProducts[$i]['price'], $latestProducts[$i]['sale_price']);

$index->assign("VAL_WIDTH", $config['gdthumbSize']+75);

$index->assign("TXT_SALE_PRICE", priceFormat($salePrice));

$index->assign("VAL_PRODUCT_ID",$latestProducts[$i]['productId']);

$index->assign("VAL_PRODUCT_NAME",$latestProducts[$i]['name']);

$index->parse("index.latest_prods.repeat_prods");

}

$index->parse("index.latest_prods");

}

$index->parse("index");

$page_content = $index->text("index");

?>

******************************************************

And here is my style "skin"/Templates/content/index.tpl

******************************************************

<!-- BEGIN: index -->

<div class="boxContent">

<span class="txtContentTitle">{HOME_TITLE}</span>

<br />

{HOME_CONTENT}

</div>

<!-- BEGIN: latest_prods -->

<div class="boxContent">

<div style="float: center; text-align: center;">

<span class="txtContentTitle">{LANG_LATEST_PRODUCTS}</span>

</div><div>

<!-- BEGIN: repeat_prods -->

<table width="100%" border="0"><tr>

<td width="{TW}%">

<br />

<div style="float: center; text-align: center;">

<a href="index.php?act=viewProd&productId={VAL_PRODUCT_ID}"><img src="{VAL_IMG_SRC}" alt="{VAL_PRODUCT_NAME}" border="0" /></a>

<br />

<a href="index.php?act=viewProd&productId={VAL_PRODUCT_ID}" class="txtDefault">{VAL_PRODUCT_NAME}</a>

<br />

{TXT_PRICE} <span class="txtSale">{TXT_SALE_PRICE}</span>

</div>

</td>

{TXT_TR}

</tr></table> <!-- END: repeat_prods -->

</div>

</div>

<!-- END: latest_prods -->

<!-- END: index -->

******************************************************

Can you see anything wrong with the files?

Sorry for all the trouble... if I could just figure that one thing out I would be gold!

Link to comment
Share on other sites

I feel stupid.

I just found out that you can change the number of items in the Latest Products section in the General Settings tab in the admin section. :)

So, I can change the products. My only problem is that it STILL only puts on item on each row... I can't figure that out. Is there another box inside there that I possibly cannot see (maybe I made the border black by accident)?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...