What are Search and Replace Filters?
Search and Replace Filters enable you to modify pages which are being returned from the server without changing source files. Search and Replace Filters can alter fixed strings or they can match regular expressions.
How do I set up a Search and Replace Filter?
From the FusionReactor Administrator, click "Search and Replace" from the table of contents (Filters section) and you will see the Search and Replace Filters screen. At the bottom of the screen is a list of currently defined filters. At the top you can enter your own filter.
The New Search and Replace Filter part of the screen likes something like this
The "Find this" select box lets you select if you want to find exact strings or regular expressions. Under that text box you enter the thing you want to search for and the "Replace With" text box is where you enter your new replacement text. Lastly you can select if you want this to apply to every instance of your search string, or only the first on each page.
How do I modify or delete a Search and Replace Filter?
As mentioned above, the Search and Replace Filters page lists existing filters. This list looks something like this:
You will notice two icons to the left of the filter. These icons are "Edit" and "Delete". If you click on the edit icon then you will see all of the information for that filter and you can modify and save it. If you want to delete a filter then click on the delete icon. You will be prompted to make sure really want to delete it, but if you click OK then it will be removed from the system.
What can Search and Replace Filters be used for?
In the example above we have a very simple Search and Replace filter which is being used to fix a typo. Any time "Fusionreactor" is found (without a capital R,) it is changed to "FusionReactor". This is a very simple use. Here are a few others:
Advanced correction
Regular expressions can be used to allow a single filter to catch many variations of a word or phrase and replace it with a corrected or updated version.
ORIGINAL HTML
Welcome to Fusion Reactor.
Welcome to fusion-reactor.
Welcome to fusionReactor.
FILTER
Find this Regular Expression:[fF]usion[ |-]?[rR]eactor
Replace With:FusionReactor
Replace: All
DELIVERED HTML
Welcome to FusionReactor.
Welcome to FusionReactor.
Welcome to FusionReactor.
Modify web page titles
Imagine you were running a special offer for a month and wanted to update the titles on your web pages. Rather than go through and update every cfm file you could simple add a filter which only updates the first occurrence of a string and replace it with your new text. Once the promotion is over, delete the filter.
ORIGINAL HTML
<html>
<head><title>FusionReactor</title></head>
<body>
Welcome to FusionReactor
...
FILTER
Find this Exact Text:FusionReactor
Replace With:FusionReactor - Special Offers!
Replace: First
DELIVERED HTML
<html>
<head><title>FusionReactor - Special Offers!</title></head>
<body>
Welcome to FusionReactor
...
Fix broken links
A file you regularly link to on another machine is moved. Search and Replace can be used to instantly fix all links which point to that file.
ORIGINAL HTML
<a href="http://oldServer.com/file.html">Read This</a>!
FILTER
Find this Exact Text:http://oldServer\.com/file.html
Replace With:http://newServer.com/file.html
Replace: All
DELIVERED HTML
<a href="http://newServer.com/file.html">Read This</a>!
Modify default form values
Maybe you want to try changing the default values on a form in order to see how it effects usage. Maybe you have inconsistent default values set up of different pages and don't know which is better. This can be done using filters and the only time you need go back to the actual code is once you've decided on your final figures.
ORIGINAL HTML
<input type="text" name="regionCode" value="2">
FILTER
Find this Reqular Expression:name="regionCode" value=".*"
Replace With:name="regionCode" value="1"
Replace: All
DELIVERED HTML
<input type="text" name="regionCode" value="1">
Remove unavailable service
Sometimes you may find that services you link to are temporarily unavailable. Using a simple filter you can remove links to these services, or replace them with notices.
ORIGINAL HTML
<a href="http://goodServer.com/service1.html">Service 1</a>
<a href="http://badServer.com/service2.html">Service 2</a>
<a href="http://badServer.com/service3.html">Service 3</a>
<a href="http://goodServer.com/service4.html">Service 4</a>
FILTER
Find this Reqular Expression:<a href="http://badServer\.com/.*</a>
Replace With:[empty]
Replace: All
DELIVERED HTML
<a href="http://goodServer.com/service1.html">Service 1</a>
<a href="http://goodServer.com/service4.html">Service 4</a>
Rebranding
How much time does it take to rebrand an application? With a small set of filters you can change application names, logos and links immediately so that you have time to then go back and fix the source pages without the extra pressure.
ORIGINAL HTML
<a href="http://oldName.com/index.html">
<img src="http://oldName.com/logo.gif">
</a>
FILTER
Find this Exact Text:oldName.com
Replace With:newName.com
Replace: All
DELIVERED HTML
<a href="http://newName.com/index.html">
<img src="http://newName.com/logo.gif">
</a>
Debugging
There are many ways in which Search and Replace filters can help you debug. Make hidden fields visible. Change meta refresh tags into normal links in order to step through multiple pages at your own pace. Dynamically add javascript to display the contents of variables or cookies.
ORIGINAL HTML
<input type="hidden" name="hiddenValue" value="2023489">
FILTER
Find this Exact Text:type="hidden"
Replace With:type="text"
Replace: All
DELIVERED HTML
<input type="text" name="hiddenValue" value="2023489">

Buy Online
