Search
Other ReReplacer questions
Forum

Replacement does not work anymore after Upgrade to Joomla 5 (replace tags)

Yannick Lämmel's Avatar Yannick Lämmel
Hi there,

I want to replace the following.
<section id="sp-main-body"><div class="container"><div class="container-inner">

I updated the site from Joomla 3 to Joomla 5. Of course, also Rereplacer is updated to the latest version. Before it worked perfectly.

If I change the search parameters to
id="sp-main-body"
then I can replace it with something different.

Is it no longer possible to include tags in the search params?

Kind regards,
Tanja
Peter van Westen's Avatar Peter van Westen ADMIN
Yes, it is possible to search for tags.
Most probably the html output is a bit different.
Check your sites html output (not the element inspector).

Also, it might be due to the system plugin ordering. Try changing the ordering of the plugins in question.
See: regularlabs.com/blog/242-plugin-order-is-important
Please post a rating at the Joomla! Extensions Directory
Yannick Lämmel's Avatar Yannick Lämmel
Hi Peter,

I checked the output and even if I only choose <section id="sp-main-body"> to replace nothing happens.
I had a look at the plugin order but couldn't find something that is not correct.

Do you have another idea?
Peter van Westen's Avatar Peter van Westen ADMIN
Do you have this online so I can take a look?
Please post a rating at the Joomla! Extensions Directory
Yannick Lämmel's Avatar Yannick Lämmel
Yes I have: The site is neu.triacs.de/jobs.html

I found out that if I search for <section id="sp-main-body" > than the rule works. So it seems that something cleans the html output.
Maybe you have an idea where I can look for the HTML code before cleaning?

I have looked at the system plugins and the only thing that might do that is JCH Optimize, but if I switch it off the HTML Code stays the same.
Peter van Westen's Avatar Peter van Westen ADMIN
JCH Optimize will indeed clean up the html. I see you switched that off now...

If you want the replacement to deal with whitespace, you can use Regular Expressions:
<section id="sp-main-body"\s*>\s*<div class="container">\s*<div class="container-inner">
Please post a rating at the Joomla! Extensions Directory
Yannick Lämmel's Avatar Yannick Lämmel
Hi Peter,

thank you for having a look. This works now.
Can you tell me why it worked in Joomla 3?
There I just wrote: <section id="sp-main-body"><div class="container"><div class="container-inner"> and everything worked.
Peter van Westen's Avatar Peter van Westen ADMIN
Because on Joomla 3 the html output was probably different.
Or you ordered ReReplacer after JCH Optimize. Or something else.
Please post a rating at the Joomla! Extensions Directory
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription