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.
Variables in snippets
Re: Variables in snippets
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.
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.
Re: Variables in snippets
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?
Re: Variables in snippets
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,"
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,"