Version indicators can help your customers identify the correct documentation they need, and help unsure users figure out which documentation they should read.
Other reasons to use version indicators:
Admin user role
To create a version indicator template:
var version = $version ?? "default";
<div class="version-indicator">
<span class="version-text">"This article applies to:"</span>
if (!version || version == "" || version =="V1")
{
<span class="version-tag version-V1">
<a class="F1 version-reference-link" href="#">"Only Version 1"</a>
</span>
}
if (version == "V2")
{
<span class="version-tag version-V2">
<a class="F1 version-reference-link" href="#">"Only Version 2"</a>
</span>
}
if (version == "both")
{
<span class="version-tag version-both">
<a class="F1 version-reference-link" href="#">"Version 1 and Version 2"</a>
</span>
}
</div>
.version-indicator {
padding:4px;
background:#efefef;
overflow:hidden;
font-size:11px;
border:1px solid #ccc;
border-radius:3px;
}
.version-indicator span {
float:left;
display:block;
margin-right:20px;
}
.version-indicator .version-text {
font-weight:bold;
}
To edit the code for your product, replace V1 and V2 in the DekiScript with versions of your product.
To add more versions, paste the following snippet at the end of the code before the </div> tag:
if (version == "V3")
{
<span class="version-tag version-V3">
<a class="F1 version-reference-link" href="#">"Only Version 3"</a>
</span>
}
To link versions to a document that explains, for example, which version a customer is using, replace the # (of the href attribute) with the path to that document.
The href attribute would look like the following: /Documentation/User_Guide/What_version_of_MindTouch_am_I_using%3F
Now that you have created the template, you must add another piece of DekiScript code to your page to surface the version indicator.
template("Custom/Views/Template_Title", {version:"V1"});
Template_Title with the title of your template. Make sure to use an underscore (_) instead of a space.V1 with the version to which the document applies. Make sure the name of the version has quotation marks around it. Two quotation marks by themselves ("") refer to "Only Version 1," while "both" refers to "Version 1 and Version 2."