Jump to content

Latest products caption length control


Ben224
 Share

Recommended Posts

Hi,

V.5.1.1

I would like to allow for more characters to be displayed in the captions or titles under the images that are displayed as a latest product. At the moment the store only displays roughly 30 letters from the actual full title including the 3 periods... This is causing my titles/caption to not make very much sense.

Can anybody point me to the code that governs the amount of characters shown so that I can make an adjustment?

Many thanks in advance.

Link to comment
Share on other sites

The truncation has moved in CC514 (at least in the Kurouto and Vanilla skins, probably all of them). This truncation is a display format decision and as such, it is the responsibility of the skin to determine how much, if any, truncation is to take place.

In the file content.homepage.php in the templates folder of any skin, find:

<p class="title"><a href="{$product.url}" title="{$product.name}">{$product.name|truncate:38:"&hellip;"}</a></p>

Change the 38 to what your skin/desires dictate, or delete the |truncate:38:"&hellip;" altogether.

Now, in the admin screen, Store Settings, Layout tab, "Length of Product Precis" records the character count that is given to the skin for the View Category (I assume) page.

So, I would expect to see a similar setting in a near future version of CC5 for the Latest Products box.

Link to comment
Share on other sites

  • 2 weeks later...
Guest alex2234

I'm using the "Killer" skin with cubecart version 4[1].3.8. I have 25 Latest Products showing on my homepade. I'd like to add some more space to each line of the Latest Products listings so their not so close together. Anyone know how to do this?

Link to comment
Share on other sites

I'm using the "Killer" skin with cubecart version 4[1].3.8. I have 25 Latest Products showing on my homepade. I'd like to add some more space to each line of the Latest Products listings so their not so close together. Anyone know how to do this?

Maybe this will help from an old thread on adjusting title length on Latest Products. Be sure you pay attention to Bsmither's information in the current thread about how this code has moved in 5.1.4.

Hello,

Bloody hard to find, but there is a line in classes/cubecart.class.php that arbitrarily truncates the title. In version 5.0.7 it is line 114, and it looks like this:

$product['name'] = (strlen($product['name'])>42) ? substr($product['name'],0,38).'&hellip;' : $product['name'];

I commented it out and suddenly I had the full titles. You may need to alter the stylesheet that controls the product box height if you have extremely long product titles, to ensure they will fit cleanly.

Thanks, CBGitty! That helped a lot. I added a bit to the height in div.latest_product of common.css and an extra <br/> after the title in content.homepage.php, and it has the full title now.

Link to comment
Share on other sites

  • 10 years 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.

 Share

×
×
  • Create New...