Multiple Targets Find and Replace Conditions

This forum is for all Flare issues not related to any of the other categories.
Post Reply
jay6678
Propeller Head
Posts: 29
Joined: Wed Mar 26, 2008 7:43 am

Multiple Targets Find and Replace Conditions

Post by jay6678 »

So maybe my subject line doesn't quite explain what I want, but.... Here's what I want to do: Create three webhelp outputs for three software applications. Let's call them "apples", "oranges" and "bananas". Now, right now I have "apples" already built, but need to create two more, one for oranges and one for bananas. Everything in the targets will be exactly the same, EXCEPT the word "apples", "oranges" and "bananas". Is there a simple way to find and replace the word "apples" and replace with conditional content that will be designated "apples", "oranges" OR "bananas". I know I can go through the entire 400 topics (yeah, it's that big) and do it topic by topic, word by word...but let's be real, who has time to do that?
Any suggestions?
lacastle
Propellus Maximus
Posts: 1028
Joined: Thu Apr 12, 2007 7:28 am
Location: Wilmington, DE
Contact:

Re: Multiple Targets Find and Replace Conditions

Post by lacastle »

I don't know how this would work, but I think Variables can be used for that purpose...or definitely conditions.
KevinDAmery
Propellus Maximus
Posts: 1985
Joined: Tue Jan 23, 2007 8:18 am
Location: Darn, I knew I was around here somewhere...

Re: Multiple Targets Find and Replace Conditions

Post by KevinDAmery »

As long as you never have to use Apples, Oranges, and Bananas at the same time, you could easily do this with a variable. You'd need three variable sets, each with the same variable name (for example, "Product"). In the first variable set, you set Product = Apple, in the second Product = Bannana, and in the third Product = Orange. Then in the target for each you specify which variable set to use, and you're off to the races.

Now, for the find and replace, you'd need to tell it to find in Whole Project instead of Current Topic, and you need to enable the Find in Source Code check box. Your find and replace would look something like this:

Find:
apple

Replace:
<MadCap:variable name="Product" />

Tip: Insert the variable in one topic then look at the topic in the internal text editor. You can find and copy the exact code for the variable to prevent typos etc. from ruining your day.

IMPORTANT: Before you do any find and replace in source code, back up your project files. If the find and replace results in invalid HTML code, you won't be able to open the topic(s) with the problem, which from painful experience I can tell you ain't a whole lotta fun to fix....
Until next time....
Image
Kevin Amery
Certified MAD for Flare
Paul Griffiths
Sr. Propeller Head
Posts: 261
Joined: Wed Apr 18, 2007 2:25 am
Location: Nottingham, UK

Re: Multiple Targets Find and Replace Conditions

Post by Paul Griffiths »

Kevin, I'm not sure why you say three variable sets are needed. Surely one variable set "Fruit" with one variable "Product" would be enough? Then just override the default value of "Product" in each of the three targets.

Also, I suspect the tag needs the name of the variable set in there too:

<MadCap:variable name="Fruit.Product" />
KevinDAmery
Propellus Maximus
Posts: 1985
Joined: Tue Jan 23, 2007 8:18 am
Location: Darn, I knew I was around here somewhere...

Re: Multiple Targets Find and Replace Conditions

Post by KevinDAmery »

Paul, you are indeed correct.

Jay - do what he said :)
Until next time....
Image
Kevin Amery
Certified MAD for Flare
doc_guy
Propellus Maximus
Posts: 1979
Joined: Tue Nov 28, 2006 11:18 am
Location: Crossroads of the West
Contact:

Re: Multiple Targets Find and Replace Conditions

Post by doc_guy »

Right. You need a single variable which can be added to the default variable set, or added to a new variable set. (I find it is easier to work with when you add to the default variable set.) Then you'd have three targets and in the target properties, you'd change the fruit variable to match the desired output for that target.
Paul Pehrson
My Blog

Image
Post Reply