Use XML Variables for Links
Using XML variables is the only way to have links that change depending on publish settings. Unlike text variables, they allow you to use full XML strings. A link's destination is determined by the URL in the underlying XML, so you can use XML variables to change the link dynamically.
With XML variables, your link label can have the same name, but the destination can change depending on your publishing settings. You can use a different label altogether or disable linking completely in some versions of your documentation. XML variables give you more flexibility than other types of variables.
As an example, if there is a product that has two versions for different markets (one for the US market and one for the European market), the link label can be the same but the link destination can point to different distribution websites. You can also change the link label to something like "US Store" for the US version of the documentation, and "Europe Store" for the European version, with different link destinations for each.
This instruction shows how to use different web pages depending on market.
-
Scroll down to Variable sets in Content Manager.
-
Select the arrow in front of the Variable sets to expand it.
-
Select Create variable set from the menu.
-
Enter a name for the variable set and select the check mark.
-
Expand the Variable sets with the arrow to the left.
-
Select the new variable set.
-
Select Add variable for each variable that is to be inserted in a topic.
-
Name it and select XML to make it a link variable.
-
Select Add variant for each variant to publish to.
-
Copy the XML code below:
<link xlink:href="ZZZ">XXX</link>
-
Replace ZZZ with the URL.
-
Replace XXX with the visible link label.
In the example, we used "Car window" and "Electric motor" as the visible link names. Scroll down to see the result.
Note
To show the URL instead, remove the XXX.
-
Open a topic and insert the created XML link variables.
-
Select the Preview tab in the Toolbar.
-
Select Profile settings.
-
Select the Variables tab.
-
Select the variable set and XML link variable to be used.
-
Select Apply.
Chosen XML link variable will be shown in the topic.
-
Publish the topic to see the visible link name.