DEBUT Theme : two lines (line break) in product titles

Highlighted
Excursionist
29 2 11

Hello,

I'm using DEBUT theme. I don't manage to force a line break in my product titles.

First attempt : I've put "<br>" in my titles products : it works very well on collection pages, product pages and in my cart. BUT unfortunately <br> appears in the pop-up window of the cart (and it might appears elsewhere, like on invoices, I never been as far yet in the command process...).

Do you know how to solve the issue please ?

I saw a lot of posts with the same query, but I didn't manage to find the whole solution.

Second attempt : after reading others posts, I've tried this :

  • I wrote "-" instead of "<br"> in one of my title product
  • I've replaced <h1 class="product-single__title">{{ product.title }}</h1> by <h1 class="product-single__title">{{ product.title | replace_first: '-', '<br>' }}</h1> in Sections > Product template liquid.
  • RESULT : it appears great on product pages, "-" appears in my cart and in the pop-up window (which is fine for me!), BUT unfortunately in collection pages "-" appears and the product title still appears as one line.

Anyone can help me please ? I've attached some pictures.

Sorry in advance for my english mistakes, this is not my mother tongue.

Thank you !

 My website is not published yet, that's why I don't give you the link. But I've attached some pictures, thanks !

Break-line-tittle-product-first-attempt.pngBreak-line-tittle-product-seconf-attempt.png

0 Likes
Highlighted
Shopify Partner
569 80 119

Hello, Are the products added using AJAX means when you click on add to cart then page does not refresh, it add the product to cart in the background?

 

If this solution works, then please accept it as solution and like.
For theme customization, please contact parambabla.soft@gmail.com
0 Likes
Highlighted
Excursionist
29 2 11

Hello param-blala, I think so, the page doesn't seem to refresh when I add an article in cart.

0 Likes
Shopify Partner
569 80 119

So, this html design is coming from jquery and it is making the br tag as string instead of html tag

If this solution works, then please accept it as solution and like.
For theme customization, please contact parambabla.soft@gmail.com
0 Likes
Highlighted
Excursionist
29 2 11

Thanks for your answer, do that mean you know how to solve the problem ? Sorry but I don't understand much things in code

0 Likes
Highlighted
Excursionist
29 2 11

I don't need help for this anymore, a developer's friend has done it. Sorry for the others, I can't tell how exactly he did.

0 Likes