Variables in snippets

This forum is for all Flare issues not related to any of the other categories.
Post Reply
Vibeke B
Propeller Head
Posts: 75
Joined: Thu Mar 15, 2018 7:14 am
Location: Denmark

Variables in snippets

Post by Vibeke B »

Why are my snippets using other variables that I have set for the target?

I have different product names which I set per target. I just found out that the snippets are not using them. By researching, I can see that I can change Snippet Variables per topic but I have not done that and do not want that. I want the snippets to use the same variables as the target. Is there an easy way to fix this, or do I have to find each wrong use and revert it manually? I have 60 snippets and hundreds of topics…

Looking forward to your great help, as usual.
NorthEast
Master Propellus Maximus
Posts: 6365
Joined: Mon Mar 05, 2007 8:33 am

Re: Variables in snippets

Post by NorthEast »

You can set snippet variables at two levels - for the topic, and for each instance of the snippet in your topic.

So if you've checked snippet variables at the topic level (in topic properties), then check each instance of the snippet in your topics - right-click the snippet and select Snippet variables.
Vibeke B
Propeller Head
Posts: 75
Joined: Thu Mar 15, 2018 7:14 am
Location: Denmark

Re: Variables in snippets

Post by Vibeke B »

So if a snippet is used in four different topics, I have to change them four times? I cannot just change it once in the snippet itself?
NorthEast
Master Propellus Maximus
Posts: 6365
Joined: Mon Mar 05, 2007 8:33 am

Re: Variables in snippets

Post by NorthEast »

Well, first check if snippet variables have been used for the individual snippets in your topics. It's not something that would happen by accident, as someone would have to deliberately set snippet variables on each snippet.

But yes, if snippet variables have been set for each instance of a snippet in your topics, then you have to change every single instance of the snippet.

If that is the case here, you may be able to fix it using find and replace in source code mode, to delete the snippet variable from the snippet tag.
For example, if this was your code:
<MadCap:snippetBlock src="Resources/Snippets/NewSnippet.flsnp" MadCap:snippetVariables="Variables.CompanyName:Whatever," />
You could find/replace this part:
MadCap:snippetVariables="Variables.CompanyName:Whatever,"
Post Reply