Jump to content

Latest products centre


Guest

Recommended Posts

If you are using a fixed width skin, you may center the latest prods by adjusting the width setting of the division holding the product. The division holding this product is found in styleTemplates/content/index.tpl, it looks like this:

<div style="float: left; text-align: center; width: {VAL_WIDTH}px;">

There are two things to understand about the styles on this division: First, it floats left. This is necessary in order to make and stack the latest products in CubeCartâ„¢. Second, there is a variable setting the width of this division, represented by {VAL_WIDTH} above. The key to centering these is to increase that width variable until you have equal spacing all the way across.

Note: Other important adjustments (off-topic) need to be made to this division, read about these at the end of this post

INCREASING THE VARIABLE WIDTH SETTING

How does CubeCart determine the value of {VAL_WIDTH}? This number comes from two places; (1) The setting for thumbnail size in ACP General Settings which sets the width of thumbnails, and (2) extra spacing added to the thumbnail width number over in includes/contents/index.inc.php

OPEN includes/contents/index.inc.php

FIND the following code:

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

CHANGE the value 75, by trial and error, until you find the magic number that creates a perfectly equal spacing for your store, thereby centering the latest products.

WHY THIS DOES NOT WORK IN KILLER SKIN

The Killer skin is dynamic width, liquid width, full-screen width, whatever you want to call it - boiled down, it means that the width of this skin varies according to screen resolution and browser window size; therefore, setting a static width number as mentioned above does not help. Best you can do here is optimize for one browser setting of your choice. Beyond that, there are little tricks you may be able to live with in order to center these, but I've droned on long enough already :innocent:

---------------------------

Other important edits to that division in styleTemplates/content/index.tpl:

- Adding a position: relative; to the styles here is often necessary in order to cure certain IE Peekaboo problems

- Adding a height: 200px; <- Height setting (actual number of pix may vary) in the styles here will cure a screwy display problem where latest products aren't stacking on the page correctly.

See also the tutorial here

Link to comment
Share on other sites

  • 1 month later...

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...