Jump to content

[SOLVED] I truncated my product titles...but this also results in truncated tooltip, how to fix?


Recommended Posts

I've truncated my product titles because there is limited room in the thumbnail, using the following code:

 32}...{/if}">{$product.name|substr:0:29|escape:'htmlall':'UTF-8'|trim}{if $product.name|strlen > 29}...{/if}



However I noticed the tooltip is truncated too. I would like this to display the full product name so customers don't have to click into the product description if they don't want to.

Any ideas on how to do this?

Link to comment
Share on other sites

Try the following:

<a href="{$product.link}" title="{$product.name|substr:0:50|escape:'htmlall':'UTF-8'|trim}{if $product.name|strlen > 50}...{/if}">{$product.name|substr:0:29|escape:'htmlall':'UTF-8'|trim}{if $product.name|strlen > 29}...{/if}



This should display the first 29 characters of the product name and the first 50 characters in the tooltip. You can increase that number if necessary.

Link to comment
Share on other sites

So that everybody reading this thread
understands what you are talking about
(and perhaps can figure out
if this could be helpful for him/her)
it could be very nice if you could quote
exact folder/file/line of the code in question.

Thank you for your kind... precision
:)

Angelo from Kolkata, India

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...