Search
Other ReReplacer questions
Forum

Advanced Use of Dynamic ReReplacer "Tag" ability with multiple variables

George Benson's Avatar George Benson
I have read multiple times the Help for the ReReplacer. I have been focused on the dynamic plugin-style tags feature. What I am trying to do is to be able to create a tag that I can pass multiple variables to and have those used in a tooltip. For instance say I am creating an article that has an affiliate link and I had a tag created that was {affiliate} - I would then want to be able to have ReReplacer search for something like:
{affiliate},"VariableProductName","VariableOnlineStore","VariableWebURL"
or
{affiliate}"VariableProductName","VariableOnlineStore","VariableWebURL"{/affiliate}
and then what is output is
{tip title="Affiliate Link" content="This PRODUCT NAME is available at ONLINE STORE by <a href "www.someurl.com">Clicking HERE</a>"}PRODUCT NAME{/tip}
so that unless someone hovers over or clicks the "PRODUCT NAME" the page looks like a page of text with PRODUCT NAME being a link.

I suspect this can be donw but I am getting confused with how to do it? Is multiple variables possible with ReReplacer?

Thanks in advance for your help and suggestions.
Peter van Westen's Avatar Peter van Westen ADMIN
To handle:
{affiliate}"VariableProductName","VariableOnlineStore","VariableWebURL"{/affiliate}

You can search (Regular Expressions on) for:
\{affiliate\}"(.*?)","(.*?)","(.*?)"\{/affiliate\}
And relace with:
{tip title="Affiliate Link" content="This \1 is available at \2 by <a href "\3">Clicking HERE</a>"}\1{/tip}

You can of course use any 'plugin tag' syntax you want and adjust the search to match it.
For instance:
{affiliate name="VariableProductName" store="VariableOnlineStore" url="VariableWebURL"}
Would become:
\{affiliate name="(.*?)" store="(.*?)" url="(.*?)"\}
Please post a rating at the Joomla! Extensions Directory
George Benson's Avatar George Benson
YOU ARE AWESOME!!

And Your customer service is ABSOLUTELY THE BEST!!

Thanks for helping me make sense of this!!

- George
Peter van Westen's Avatar Peter van Westen ADMIN
My pleasure ?
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