Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
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
Solved! Go to the solution
This is an accepted solution.
Hi @TheFabFriend21,
Please go to snippets > card-product.liquid file, find 'card_product.title' and remove code here:
Hope it helps!
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.
@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
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.
I followed these steps but my color variants do not show up, do you have a solution?
This is an accepted solution.
Hi @TheFabFriend21,
Please go to snippets > card-product.liquid file, find 'card_product.title' and remove code here:
Hope it helps!
This worked, thank you so much
This worked thank you.
Hello, I have the dawn theme and cannot find card_product.title in the liquid code. What would be the next best thing to look for or change?
Website: Square Wood Photo Print (1:1 Ratio) – Shimlee (shopifypreview.com)
Live View Password: Khome200
Hi! I tried this solution and it worked. However, now the <br/> is showing up in my product listing in the title. Are you able to suggest any workaround for this?
My store URL is: https://verterra.sg/password, password is VerterraTest123
Hi Verterra,
Did you find a workable solution?
I'm having the same problem😭
If you have found one, would you please share with me? Much appreciated!!!!!!!