- Posts: 101
- Thank you received: 10
Minor fixes in the character limit of the short description in mod_eshop_product
- Impression eStudio
- Topic Author
- Offline
- Premium Member
Less
More
11 months 4 weeks ago - 11 months 4 weeks ago #162911
by Impression eStudio
Minor fixes in the character limit of the short description in mod_eshop_product was created by Impression eStudio
The "Eshop Product" module has the option to limit the number of the characters of the short description.
In order the PHP code to do better job, especially for languages except English, the lines:
should change to:
The above change refers to all the files in the folder "modules/mod_eshop_product/tmpl".
In order the PHP code to do better job, especially for languages except English, the lines:
Code:
if ($shortDescLimited > 0 && strlen($productShortDesc) > $shortDescLimited)
{
$productShortDesc = substr($productShortDesc, 0, $shortDescLimited) . '...';
}
should change to:
Code:
if ($shortDescLimited > 0 && mb_strlen($productShortDesc, 'UTF-8') > $shortDescLimited)
{
$productShortDesc = trim(utf8_substr($productShortDesc, 0, $shortDescLimited)) . '...';
}
The above change refers to all the files in the folder "modules/mod_eshop_product/tmpl".
Last edit: 11 months 4 weeks ago by Impression eStudio.
The following user(s) said Thank You: Giang Dinh Truong
Please Log in or Create an account to join the conversation.
- Giang Dinh Truong
- Offline
- Administrator
11 months 3 weeks ago #163025
by Giang Dinh Truong
Replied by Giang Dinh Truong on topic Minor fixes in the character limit of the short description in mod_eshop_product
OK Thank you!
I will look at this.
Sincerely, Giang
I will look at this.
Sincerely, Giang
Please Log in or Create an account to join the conversation.
- Impression eStudio
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 101
- Thank you received: 10
10 months 3 weeks ago #163772
by Impression eStudio
Replied by Impression eStudio on topic Minor fixes in the character limit of the short description in mod_eshop_product
Hi and thank you for fixing this issue in version 3.9.0.
I just wanted to mention one small thing here in case you want to fix it too.
The short description sometimes (depending on the editor) may include html like <p>short description</p>.
In these cases the three dots are added after these tags, so they go to a new line.
Please see the attached image.
Could you please strip the html tags?
Thanks
I just wanted to mention one small thing here in case you want to fix it too.
The short description sometimes (depending on the editor) may include html like <p>short description</p>.
In these cases the three dots are added after these tags, so they go to a new line.
Please see the attached image.
Could you please strip the html tags?
Thanks
Please Log in or Create an account to join the conversation.
- Giang Dinh Truong
- Offline
- Administrator
10 months 3 weeks ago #163792
by Giang Dinh Truong
Replied by Giang Dinh Truong on topic Minor fixes in the character limit of the short description in mod_eshop_product
Hello Impression,
In the latest version 3.9.0, I limit the length of short description by stripping the html tag to avoid breaking layout. The ... because that line does not have enough space to display it. It does not replated to html tags because I ignore html tags.
Sincerely, Giang
In the latest version 3.9.0, I limit the length of short description by stripping the html tag to avoid breaking layout. The ... because that line does not have enough space to display it. It does not replated to html tags because I ignore html tags.
Sincerely, Giang
Please Log in or Create an account to join the conversation.
- Impression eStudio
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 101
- Thank you received: 10
10 months 1 week ago #164203
by Impression eStudio
Replied by Impression eStudio on topic Minor fixes in the character limit of the short description in mod_eshop_product
Hi Giang,
As you can see in the code of the screenshot the html code remains in the short description.
Also I checked the code of the module mod_eshop_product and I see that you use the function StringHelper::truncate which has the parameter $allowHtml but you don't use it and the default value is true which means that the html in the description is allowed and not stripped.
Thanks for getting in these details.
As you can see in the code of the screenshot the html code remains in the short description.
Also I checked the code of the module mod_eshop_product and I see that you use the function StringHelper::truncate which has the parameter $allowHtml but you don't use it and the default value is true which means that the html in the description is allowed and not stripped.
Thanks for getting in these details.
Please Log in or Create an account to join the conversation.
- Giang Dinh Truong
- Offline
- Administrator
9 months 4 weeks ago #164568
by Giang Dinh Truong
Replied by Giang Dinh Truong on topic Minor fixes in the character limit of the short description in mod_eshop_product
Hello,
$allowHtml is true means that Allow HTML tags in the output, and close any open tags. It does not count html tags while truncating.
Sincerely, Giang
$allowHtml is true means that Allow HTML tags in the output, and close any open tags. It does not count html tags while truncating.
Sincerely, Giang
Please Log in or Create an account to join the conversation.
Moderators: Giang Dinh Truong
Support
Documentation
Information
Copyright © 2024 Joomla Extensions by Joomdonation. All Rights Reserved.
joomdonation.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.