Search
Other ReReplacer questions
Forum

replace href by button

Laurent Lacoste's Avatar Laurent Lacoste
Hi,

I have a question regarding ReReplacer and I don't know if he can do that.
I would like to implement a topical mesh on my website and to do that I need to obfuscate main menu a link for google bots.
The idea is do that : prnt.sc/mmr78CmVMpfM

Do you think this could be done with ReReplacer ?

Thanks
L.
Peter van Westen's Avatar Peter van Westen ADMIN
Yes, just search and replace for that...

It can be that internal urls look a bit different at the time ReReplacer gets to see the html. So you might need to use Regular Expressions to find the right link.

Can you give an actual example of before and after? And is it an internal page that is in the link?
Please post a rating at the Joomla! Extensions Directory
Laurent Lacoste's Avatar Laurent Lacoste
here is an example before / after : prnt.sc/mmr78CmVMpfM

another point : replacement done thanks to ReReplacer plugin are done with javascript or php?
Peter van Westen's Avatar Peter van Westen ADMIN
And is it an internal page that is in the link?

ReReplacer works on the php level and replaces stuff in the html output. So you should see the changes if you view the source of the page (which is different than Inspect Element).
Please post a rating at the Joomla! Extensions Directory
Laurent Lacoste's Avatar Laurent Lacoste
yes, link inside is internal link.
do you have any idea about code / regex to use to replace that?

ok for php.
Peter van Westen's Avatar Peter van Westen ADMIN
If the text inside the link is unique enough, just do:
<a href="([^"]*)">CONTACTEZ NOUS</a>
Replace:
<a onclick="location.href='\1'">CONTACTEZ NOUS</a>
See what the result is...
Please post a rating at the Joomla! Extensions Directory
Laurent Lacoste's Avatar Laurent Lacoste
ok I will try and come back to you if necessary.
thanks again
Laurent Lacoste's Avatar Laurent Lacoste
I have tried this : i.imgur.com/sWhCK2S.png
But from front-end link looks like the same : i.imgur.com/Hti8yrz.png
Peter van Westen's Avatar Peter van Westen ADMIN
See my previous reply. Use that and the Regular Expressions.
Please post a rating at the Joomla! Extensions Directory
Laurent Lacoste's Avatar Laurent Lacoste
same result.
here are my settings : i.imgur.com/KVdWzoP.png
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
Laurent Lacoste's Avatar Laurent Lacoste
yes here : www.toonetcreation.com
link where I try to replace the code : i.imgur.com/Xceb0P5.png
Peter van Westen's Avatar Peter van Westen ADMIN
Like mentioned earlier, you need to look at the html output. Not the element inspector.
In the html output, there is:
<a href=/contact.html>Contact</a>
Which is not the same as what you are searching for.
Please post a rating at the Joomla! Extensions Directory
Laurent Lacoste's Avatar Laurent Lacoste
ok So what should be the right settings?
I'm sorry I try to understand how it works exactly.
Peter van Westen's Avatar Peter van Westen ADMIN
Try searching for:
<a href=/contact.html>Contact</a>
And replace with what you need.

PS: If you need further support on ReReplacer, please purchase a subscription.
Please post a rating at the Joomla! Extensions Directory
Laurent Lacoste's Avatar Laurent Lacoste
OK I did this : i.imgur.com/UnMZZsP.png

works for you?
Peter van Westen's Avatar Peter van Westen ADMIN
PS: If you need further support on ReReplacer, please purchase a subscription.
Please post a rating at the Joomla! Extensions Directory
Laurent Lacoste's Avatar Laurent Lacoste
you mean a licence or a support licence?
Peter van Westen's Avatar Peter van Westen ADMIN
A subscription on ReReplacer.
I do not offer support on the free versions.
Please post a rating at the Joomla! Extensions Directory
Laurent Lacoste's Avatar Laurent Lacoste
Ok no problem.
after subscription done, do I need to open a new ticket or can I come back on this thread?
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription