Search
Other ReReplacer questions
Forum

How to replace strings with links in bulk, excluding a single article?

Wim de Ruijter's Avatar Wim de Ruijter
I've got a site with multiple cities on it. Each city is an article: Amsterdam, Rotterdam, Bristol, et cetera.

Now I would like to replace all the mentions of Amsterdam within a paragraph for a link to the amsterdam article in all articles. Except in the Amsterdam article itself.

For a single city like Amsterdam that is quite easy:
1. I search for "amsterdam" (not case sensitive)
2. within the body
3. only between <p> and </p>, not in html tags
4. I exclude the article "Amsterdam" itself
5. I replace it with <a href="/bestemmingen/nederland/amsterdam-stedentrip">Amsterdam</a>. (This href can be different than the article name. It doesn't have to be the SEO friendly url, the joomla uri would be fine as well)

But my site has hundreds of cities for which I'd like to do this. Is there an easier way than making hundreds of rereplacer items? Any tips to achieve this?
Peter van Westen's Avatar Peter van Westen ADMIN
Making a list of 100 names, and have them get replaced by links dynamically is possible.
However, dynamically excluding the article with that name is not. At least not in a workable lightweight way with ReReplacer.

I think it would be better for you to make a plugin specifically for that purpose.
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