Using alternate variable definitions

This forum is for all Flare issues not related to any of the other categories.
Post Reply
Nick-Metcalfe
Propeller Head
Posts: 16
Joined: Fri May 28, 2021 4:12 am

Using alternate variable definitions

Post by Nick-Metcalfe »

I have multiple definitions on my global variables list for different variables such as "product names" Is it possible to define which definition on the drop down to use if I want to talk about two different products? So say I am on Product A's target and want to draw a comparison to Product B can I choose the Product B name from the variable definitions even though the variable definiton on the target is set to Product A?
Cheers
Nick
NorthEast
Master Propellus Maximus
Posts: 6359
Joined: Mon Mar 05, 2007 8:33 am

Re: Using alternate variable definitions

Post by NorthEast »

Yes, if the content is inside a snippet, you can specify the variable definition to use within that snippet - called a "snippet variable".
I briefly mentioned this in your other post - viewtopic.php?f=13&t=33979&p=145306#p145295 - so, variable definitions for the snippet will take precedence over the definition set in the target.

Say your snippet contains text like this:
<Variable.Product> is <Variable.Description>

You could insert two instances of that snippet in the same topic, and use the Snippet Variables feature to set the variable definitions used in each instance of the snippet:
<Product A> is <great>
<Product B> is <rubbish>

Now say that you'd set <Variable.Product> to <Product A> in your target, then that would be used by default, so you wouldn't need to set the snippet variables for the first instance of that snippet.
You'd only need to set the snippet variables for the second instance of the snippet, where you want it to be different to the variable definition you set for the target.

You can set snippet variables at either the topic level (applies to all snippets in that topic) or for individual instances of the snippet (where snippets in the same topic will use different variables).
See: https://help.madcapsoftware.com/flare20 ... ppets1.htm
Nick-Metcalfe
Propeller Head
Posts: 16
Joined: Fri May 28, 2021 4:12 am

Re: Using alternate variable definitions

Post by Nick-Metcalfe »

Dave Lee wrote:Yes, if the content is inside a snippet, you can specify the variable definition to use within that snippet - called a "snippet variable".
I briefly mentioned this in your other post - viewtopic.php?f=13&t=33979&p=145306#p145295 - so, variable definitions for the snippet will take precedence over the definition set in the target.

Say your snippet contains text like this:
<Variable.Product> is <Variable.Description>

You could insert two instances of that snippet in the same topic, and use the Snippet Variables feature to set the variable definitions used in each instance of the snippet:
<Product A> is <great>
<Product B> is <rubbish>

Now say that you'd set <Variable.Product> to <Product A> in your target, then that would be used by default, so you wouldn't need to set the snippet variables for the first instance of that snippet.
You'd only need to set the snippet variables for the second instance of the snippet, where you want it to be different to the variable definition you set for the target.

You can set snippet variables at either the topic level (applies to all snippets in that topic) or for individual instances of the snippet (where snippets in the same topic will use different variables).
See: https://help.madcapsoftware.com/flare20 ... ppets1.htm
Excellent thank you, this works a treat :D
Cheers
Nick
Post Reply