v1.7-v8x Product title in maximum two lines.

Drz

Member
XNullUser
Joined
Feb 18, 2024
Messages
57
Reaction score
0
Points
6
Location
Romania
NullCash
25
Hi all,
I need your help.
I want the titles of the products to be a maximum of two lines regardless of its length. I have offset images due to the fact that some titles are longer.
What can i do? Is there a module that can solve this, or a line of code?
PS: I know how to do it, but I'm not an experienced user. Thanks in advance.
 

vivozivo

Well-known member
Diamond
Elite
Joined
Sep 24, 2019
Messages
1,064
Reaction score
495
Points
83
NullCash
12
You can use Warehouse theme and then on the dashboard you can control number of lines
1713170057462.png
1713170090333.png
1713170116601.png
Post automatically merged:

or you can use CREATIVE ELEMENTS plugin and creates product miniature layout with Title set to one line or multiline.1713170426419.png
 
Last edited:

Drz

Member
XNullUser
Joined
Feb 18, 2024
Messages
57
Reaction score
0
Points
6
Location
Romania
NullCash
25
thank you, i will try this. I'm currently using the Zone theme and it doesn't have these options.
 

ziomeks

Member
XNullUser
Joined
Sep 22, 2021
Messages
202
Reaction score
0
Points
16
NullCash
104
In your tpl files with variables {$product.name} add a truncate statement for example {$product.name|truncate:90:'...'}, you can change this dots to nothing or something another

This files u will find propably in folder themes/YOUR_THEME_NAME/templates/catalog/_partials/miniatures/product.tpl or similary file
 

Drz

Member
XNullUser
Joined
Feb 18, 2024
Messages
57
Reaction score
0
Points
6
Location
Romania
NullCash
25
In your tpl files with variables {$product.name} add a truncate statement for example {$product.name|truncate:90:'...'}, you can change this dots to nothing or something another

This files u will find propably in folder themes/YOUR_THEME_NAME/templates/catalog/_partials/miniatures/product.tpl or similary file
Thank you very much, it worked, I'm glad to be part of this community with you!
Post automatically merged:

In your tpl files with variables {$product.name} add a truncate statement for example {$product.name|truncate:90:'...'}, you can change this dots to nothing or something another

This files u will find propably in folder themes/YOUR_THEME_NAME/templates/catalog/_partials/miniatures/product.tpl or similary file
can you please tell me how I can ease the title on the left?
 
Last edited:

ziomeks

Member
XNullUser
Joined
Sep 22, 2021
Messages
202
Reaction score
0
Points
16
NullCash
104
Its depends which element use your theme for part of name product, but your can found this in the same file where you add truncate...
If it a syntax<a href="..."></a> make a class for this for example <a class="name_product" href="..."></a> and then in file themes/YOUR_THEME_NAME/templates/assets/css/custom.css add this YOUR_CLASS for this purpose is a name_product{text-align:left;} and its all but if this is a <div></div> you to need add class and then in the custom.css add something like this your_class{float:left;}

If it possible give me the code from your file or make screen shot
 

Drz

Member
XNullUser
Joined
Feb 18, 2024
Messages
57
Reaction score
0
Points
6
Location
Romania
NullCash
25
Depinde ce element folosește tema ta pentru o parte a numelui produsului, dar îl poți găsi în același fișier în care adaugi truncate...
Dacă este o sintaxă<a href="..."></a>, faceți o clasă pentru aceasta, de exemplu <a class="name_product" href="..."></a> și apoi în temele fișierului/ YOUR_THEME_NAME/templates/assets/css/custom.css adăugați acest YOUR_CLASS în acest scop este un name_product{text-align:left;} și totul, dar dacă acesta este un <div></div>, trebuie să adăugați o clasă și apoi în custom.css adăugați ceva de genul acesta dvs._class{float:left;}

Dacă este posibil, dați-mi codul din fișierul dvs. sau faceți captură de ecran
Screenshot 2024-04-20 173815.png
I have attached a print screen, I hope it helps. thank you
 

ziomeks

Member
XNullUser
Joined
Sep 22, 2021
Messages
202
Reaction score
0
Points
16
NullCash
104
Delete line 53 its only example and look on line 52 with <h5........ There is a class product-name so you can use this class to move this element to left side with this code
Code:
.product-name{
    text-align:left;
}
put this part code in last lines themes/YOUR_THEME_NAME/templates/assets/css/custom.css
 

Drz

Member
XNullUser
Joined
Feb 18, 2024
Messages
57
Reaction score
0
Points
6
Location
Romania
NullCash
25
Screenshot 2024-04-20 191244.png
Correct? I see that it doesn't change at the moment, I cleared the cache.
 

ziomeks

Member
XNullUser
Joined
Sep 22, 2021
Messages
202
Reaction score
0
Points
16
NullCash
104
yes its correct, could you send mi link to your site there or private message?
 
Top