Is there any way how to create the reference to the external *.chm file to be variable-dependent in the sense of the opened file? The code in the part of the text is as follows:
<a onclick="parser ('Clarity.chm');" style="text-decoration: underline;cursor: hand;font-size: 8pt;">Click here to open the <MadCap:variable name="oem.Clarity" /> Main help</a>
I'm able to OEM-ize the software name in the text of the link using Variables (as can be seen in the code part), but I would like to call differently named *.chm file based on the variables in the output (some OEM partners do not have the same name of the *.exe file and thus the *.chm file as our main product). Is there any way how to do that? I tried to change the Clarity.chm part in the code by the <MadCap:variable name="oem.ClarityChm" /> variable part, but that doesn't seem to work, < tags are not allowed there...
No: embedding a tag set (such as a variable) inside another tag is illegal in the XML standard. You could use a variable to control the link text (nesting tags is allowed), but you could not to change the link itself because that would require putting the variable tag inside the a tag definition.
You might be able to do something with javascript to replace the entire link on the fly. A simpler approach, though, would be to add separate links to all the appropriate CHM files, then apply conditions to each link to include / exclude them as appropriate.
Until next time....
Kevin Amery
Certified MAD for Flare
Thanks for the answer, I feared that it would be so. Unfortunately, your solution would currently need 20+ conditional texts due to the number of OEM versions we would need, which (I fear) is not worth the effort. Thank you anyway.
I don't know if this will work, but someone was trying to put a variable as part of a hyperlink and what they ended up doing was copying the way the variable was added to a TOC entry and pasting that code into the hyperlink, and it worked. I'm not sure if that would work here, but you could try it. Look in the Flare help or the MadCap knowledgebase for how to use variables in TOC entries.
Lisa Eagles may soar, but weasels aren't sucked into jet engines. Warning! Loose nut behind the keyboard.
I think your only option is to convert the madcap variable into a Javascript variable, and then use that in your event handler for the A link. One way would be to include a hidden paragraph, and then a small script that sets up a Javasscript variable with the text of that paragraph. You could include this code at the top of your masterpage