Global Replace Text with a Variable
With Paligo's find and replace feature, you can replace a commonly used term with a variable. This is useful if you know a term has been used many times in your content, but it was not created as a variable. For example, if you import content from another format, you might want to replace all instances of a business name with a variable for the business name. Once the variable is in place, you can edit all of the instances at once by making the change to the variable.
Note
In the following procedure, you will need to create a Variable Set and add a variable and variant to it. If you are unfamiliar with setting up Variable Sets and variables, you can find more information in Create a Variable Set.
To do a global search for text and replace it with a variable:
-
Create a new Variable Set.
-
Add a variable to the set, for example, a text variable for a business name. When you add the variable, give it a name that describes what the variable is, for example, "business name", "slogan", "product name".
-
Enter a variant for the variable. This is where you define the text that will appear in your topics, where the variable is used. For example, if you had a business name variable, you could have "Acme industries" as a variant.
-
Open a topic that contains the text that you want to replace.
-
Add a variable to the topic.
-
Select Insert and then Variable.
-
Choose your Variable Set and then select the variable you want to use.
-
-
Select the Edit menu and then select the Edit Source Code icon.
-
In the Source Code, find the variable code. It is a
phrase
element and should look similar to this:<phrase xinfo:varset="210686" xinfo:variable="36"></phrase>
The XML also shows a reference to the Variable Set and a reference to the variable in that set.
-
Copy the entire
phrase
element code to your computer's clipboard. -
Select the search icon in the top-corner, near your avatar.
-
Select the advanced search icon.
-
Select the Replace tab.
-
In the Find what field, enter the term that you want to replace with a variable.
-
In the Replace with field, paste the phrase code for your variable.
-
Select Search.
Paligo presents a list of all the instances of the term.
-
Check the box in the left column for each term that you want to replace.
-
Select Replace.
Paligo replaces all of the selected terms with the variable.