Search
Other ReReplacer questions
Forum

Remove search value if replacement is empty?

Stanley Rieck's Avatar Stanley Rieck
Hi,

I would like to know if it is possible to remove/replace a search value if there is nothing entered in the replace section?

i.e

Search box= some-text
Replace box= "empty"

If some-text has no replacement, can some-text be "removed"?

I am using this in a helix template database, and the following is happening:

I use a code for the Facebook link in the search box: fb-ln
If nothing is entered then the icon for Facebook still shows on the website, I would have thought if nothing is entered, it would not show (i.e. it would be blank), but it still does, probably because in the helix template file, it still references fb-ln?

Since the fb-ln is changed with RSForm, when submitting a form, I need the code in the template, to know where to change fb-ln to the entered Facebook link. However, if the form does not submit a Facebook link (ie the client doesn't enter a Facebook link), the Facebook icon still shows...

I may have explained this in a very complicated way...

reds.medemo.co.za/rtest1/home.html <-- the top social media links all have codes that should change, but when noting is entered the icons still show?
Peter van Westen's Avatar Peter van Westen ADMIN
Yes, when leaving the replacement field empty, it will remove the search string.

So what do you have in the search field?
Please post a rating at the Joomla! Extensions Directory
Stanley Rieck's Avatar Stanley Rieck
Hi,

Yes I also thought it would just be empty, but I have fb-ln in the search, and the replace is blank... Yet the icons still display? I have the fb-ln placed in the Facebook link from Helix template, so even though it is "replaced " with nothing, it still shows the icon?
Peter van Westen's Avatar Peter van Westen ADMIN
There is nop 'fb-ln' in your html output.

If you want to remove the entire icon, your search needs to match the HTML of the complete icon.
And that HTML needs to be in the actual HTML output of your site.
This means the HTML as it is at pageload. You can see that by choosing the 'View Source' option in your browser, not the 'Inspect Element' option.

If icons or classes are added via javascript, then ReReplacer cannot see them.
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