New Shopify Certification now available: Liquid Storefronts for Theme Developers

Line break in Product Name

Solved
TheFabFriend21
Shopify Partner
12 0 2

I'm using Dawn theme and want line breaks in my product titles. I had "<br/>" in the title but it's not giving me the line break. Anyone else have any idea how to insert line breaks?

 

TIA for your help

Accepted Solution (1)
LitExtension
Shopify Partner
4860 1001 1115

This is an accepted solution.

Hi @TheFabFriend21,

Please go to snippets > card-product.liquid file, find 'card_product.title' and remove code here:

Screenshot.png

Hope it helps!

LitExtension - Shopping Cart Migration Expert
Check out our Shopify migration app to migrate your online store to Shopify

View solution in original post

Replies 5 (5)
KetanKumar
Shopify Partner
36720 3634 11914

@TheFabFriend21 

Sorry you are facing this issue, it would be my pleasure to help you.

Welcome to the Shopify community!😊
Thanks for your good question.

Please share your site URL,
I will check out the issue and provide you a solution here.

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help
Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
TheFabFriend21
Shopify Partner
12 0 2

@Ketan Thank you for your assistance. As you can see from the following page, when there are 2 lines for the product title, all other info lines up perfectly. The html code for line breaks doesn't work with this theme.

 

https://thefabfriend.com/collections/fragrance-roll-ons?page=11&sort_by=title-ascending

Fallen_Angel
Visitor
1 0 0

I don't see that you resolved this, as you still have <BR> on your page and in your cart.  However, you can replace the <BR> with a hyphen.  It isn't a perfect solutions but looks less like a coding error and more intentional.  On the main page it will still have the double lines, but in the description and cart it will have a hyphen.  Just make sure to put a space on either side of the dash that you want a page break.

In the spaces he said to delete the " | Escape "  instead replace it with

 " replace:' - ','<br>'  "  (leave off the "")

 

So the lines will look like this:  {{ card_product.title | replace:' - ','<br>' }}

 

You will have to go into all your products and change the <br> you put in place to a hyphen but it works for me and I think it is a good work around.  Thought I would share.

LitExtension
Shopify Partner
4860 1001 1115

This is an accepted solution.

Hi @TheFabFriend21,

Please go to snippets > card-product.liquid file, find 'card_product.title' and remove code here:

Screenshot.png

Hope it helps!

LitExtension - Shopping Cart Migration Expert
Check out our Shopify migration app to migrate your online store to Shopify
TheFabFriend21
Shopify Partner
12 0 2

This worked, thank you so much