I have a product listing, in which the title of the product is written. What I want to do is check if the product title is longer than 2 lines, and in that case, print just enough to fit in 2 lines and put "..." in the end.

Any ideas?