How can i display partial title in colletion like image 1?
Thanks
A user seeks to display truncated collection titles on their Shopify store, showing an example image where long product titles are cut off with ellipsis instead of wrapping to multiple lines.
Solutions Provided:
Multiple developers offered CSS-based solutions, primarily using:
overflow: hiddentext-overflow: ellipsis-webkit-line-clamp: 1-webkit-box-orient: verticalThese styles target the .card__heading class to limit titles to a single line.
Implementation Methods:
theme.liquid file directly, inserting code above the </head> tagResolution:
The user confirmed success using PageFly-Noah’s solution, which involved adding custom CSS code to the theme. A follow-up note mentioned potential empty space issues if text width doesn’t match the image width, suggesting careful adjustment of width values in the CSS.
This is Noah from PageFly - Shopify Page Builder App
I can help you. Please can you provide the website url. Thank you.
Best regards,
Noah | PageFly
Hello,
Welcome to the Shopify Community.
I read your problem and it seems that I need to analyze your website to provide the solution here.
Would you please share your website URL and if your website is password protected then also provide the password.
Hello @anhtaivnpro
Can you share store URL?
Yes, my store: http://vartdigitals.com
Hi @anhtaivnpro you can add code here:
Step 1: Online Stores > Themes > Edit code
Step 2: Choose file theme.liquid
Step 3: Add code above the tag
Hope my solution will help you resolve the issue.
Thank you.
Go to your online store → customize → settings → custom css
and paste this code there
.card__heading {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
Step 1: Online Stores > Themes > Edit code
Step 2: Choose file theme.liquid
Step 3: Add code above the tag
.card__content .card__information .card__heading .full-unstyled-link {
width:200px white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
@media screen and (max-width: 450px) {
.card__content .card__information .card__heading .full-unstyled-link {
width: 142px;
white-space: nowrap;
overflow: hidden;
overflow:hidden;
text-overflow: ellipsis;
}
}
Log in to your Shopify admin panel
Navigate to Online Store > Themes.
Select the theme you want to modify and click Actions > Edit code.
Find the title section: H3
You can use this code
.card__heading {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
I will hope this will helpful
Thanks so much, it’s worked!
@anhtaivnpro
Please mark my solution correct if you found it helpful.
Thanks.
I tried this method from mr PageFly-Noah and it worked. Thanks all