Article addon - why lost formating in Introtext? - Forum | JoomShaper
Solved SP Page Builder

Article addon - why lost formating in Introtext?

Asked by TomaszGrzechnik 2 years ago Last activity 2 years ago

Hi,
Why html tags are removed in Introtext in Article addon?
All is visible, but I want to leave formating like <b>, </br> and others in introtext.
I have for example:
<h5>TEXT1</h5>
<h5>TEXT2<br /><strong><span style="color: #008000;">TEXT3</span></strong></h5>
<h5>TEXT4<br /><br />

on site have:
TEXT1 TEXT2 TEXT3 TEXT4

<div class="sppb-article-introtext">TEXT1 TEXT2 TEXT3 TEXT4
</div>

Accepted answer

Marked as the solution
Ofi Khan Staff

You are welcome 😊

It is not a problem. It is developed this way. Yes, the change will stay since I have taken a new overridden file.

Please accept the answer that helped you. It will be then easier to find the solution for the other users with the same issue. There is a button to accept answer after each comment.

I have a humble request too. It would be very kind of you if you can manage some moment to give us feedback on 

  1. Joomla Extension Directory
  2. TrustPilot

This will inspire us to improve.

8 more replies

Ofi Khan Staff

Hello TomaszGrzechnik

Please go to this location:

templates/your_template_name/sppagebuilder/addons/articles

and create site.php file with the attached file. You need to unzip the file and then replace.

site.php.zip

This will allow you to keep the formatting of introtext.

Best regards

Alexander Krasovskiy

Is this functionality - preserving the formatting of introtext - something that will be in next update? Or we will have to patch site.php every time?
Thanks,
Alexander

TomaszGrzechnik Asked this

Thanks for quick reply,
But..
After upload site.php to template folder (I have HelixUltimate) Introtext have html tags, but I have layout with 4 articles horizontal and I see only one which is very long (more than 5000px), and other articles gone...

I see there is only one change in site.php to oryginal in line 405:

$output .= '<div class="sppb-article-introtext">' . mb_substr(strip_tags($item->introtext), 0, $intro_limit, 'UTF-8') . '...</div>';

new:
$output .= '<div class="sppb-article-introtext">' . mb_substr($item->introtext, 0, $intro_limit, 'UTF-8') . '...</div>'

Can you check in your enviroment why this not works?

Ofi Khan Staff

It works fine. Please share me the URL where it does not work. I will have to check.

TomaszGrzechnik Asked this

Hi Ofi,
On one site centrum-hit.pl there is a problem, but I check on other and you right - all is OK :)
Can you help me to check what is wrong? Maybe when you see at page code you find something?

Ofi Khan Staff

Please share your administrator access here to check the issue. Use the Hidden Content box to share the credentials. Make sure that you have a full site backup with you before sharing.

TomaszGrzechnik Asked this

Hi,
In hidden content you have credentials.
Keep in mind that silte is live :)

Ofi Khan Staff

I have fixed your issue. Please check your site.

TomaszGrzechnik Asked this

Thanks a lot Ofi :)

I see you made changes in line 405 site.php to:
$output .= '<div class="sppb-article-introtext">' . $item->introtext . '...</div>';
from:
$output .= '<div class="sppb-article-introtext">' . mb_substr($item->introtext, 0, $intro_limit, 'UTF-8') . '...</div>';

Is this was a problem?

And what if will be new template update? Did changes will stay?

Log in to reply.