Search
Other ReReplacer questions
Forum

Changing the url when a button is hit

Winfried Buijen's Avatar Winfried Buijen
Hi Peter,

How can I change the url of a button when it is clicked on?
I tried this several times by copying the code from the selector (firefox), but this seems not the right way.

I am using Community Builder and I want to change the url to another page after sending mail to another user.
The website is claim.games, but the page is only accessable for members.

If you need any information or a user to the frontend or backend, let me know.
Peter van Westen's Avatar Peter van Westen ADMIN
You should not use the code inspector in your browser, but the 'View Source' option.
ReReplacer can only replace stuff in the rendered HTML output of the site. It cannot replace in content that is dynamically created via javascript.
Please post a rating at the Joomla! Extensions Directory
Winfried Buijen's Avatar Winfried Buijen
Peter,

I have tried these two options:
1a. https://claim.games/index.php/cb-profile?reason=canceledit
1b. https://claim.games/index.php/community/overzicht-spelers-en-locaties

2a. {window.location = 'https://claim.games/index.php/cb-profile?reason=canceledit';}
2b. {window.location = 'https://claim.games/index.php/community/overzicht-spelers-en-locaties';}

Neither work.
Have you any suggestions what string I should replace?

Kind regards.
Peter van Westen's Avatar Peter van Westen ADMIN
Replacing URLs is a bit tricky, as URLs can be different at the moment ReReplacer gets to see the HTML code. ANd are then changed by the Joomla SEF plugin (among others) at a later stage.

But what exactly are you trying to do?
Changing an URL inside the HTML output with a {window.location = '...'} syntax can fully break your HTML if it is for instance found in the href attribute of a link.
Please post a rating at the Joomla! Extensions Directory
Peter van Westen's Avatar Peter van Westen ADMIN
But what exactly are you trying to do?
So can you give a full example of the HTML of the button as it is now?
And what you want to change it to.
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