You are here:  » featured.php image and txt limits


featured.php image and txt limits

Submitted by gahanpip on Mon, 2017-03-20 11:16 in

in featured.php is there a way to limit image and txt limits, constrain them to their boxes? I am finding feeds from CJ have images that are to large at times and the text is far to long making the page messy.

Philip

Submitted by support on Mon, 2017-03-20 13:21

Hello Philip,

Sure - to limit the text length, look for the where the product name is output within around line 11:

<span class='pt_fp_name'><?php print $product["name"]; ?></span>

...and REPLACE with:

<span class='pt_fp_name'><?php print tapestry_substr($product["name"],50); ?></span>

...adjusting the length parameter (50 in the above) in the call to tapestry_substr() as required; which is a tidy sub-string function that splits on the next SPACE character after the length required.

Regarding images, look for the default Featured Products img class definition in html/default.php around line 40:

  .pt_fp_image {
    border: 0;
    height:100px;
    max-width:none;
  }

...and if the problem is images extending to the right, try fixing width instead (only 1 dimension of an image should be fixed otherwise it can lead to distortion) e.g.;

  .pt_fp_image {
    border: 0;
    width:100px;
  }

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by gahanpip on Mon, 2017-03-20 15:34

brilliant, thank you