Skip to main content

Add a version indicator to your documentation (SAP KC)

Written by Miller Saltzman
Documentation Editor, Customer Success at MindTouch

Want to save your customers and your support agents some time? This document explains how to create a custom template in MindTouch that will tell your customers and support agents which of your products the article they are viewing applies to. 

Why should I use this?

  • If you have multiple products in MindTouch, you and your customers can save time by knowing what product your articles apply to before reading them.
  • If your users are confused about which product they are using they can easily find out by clicking the version referenced in the template (to do this go to step four).
  • If you want to deprecate an old version.
  • If you want to encourage customers to upgrade to a new product, this template could show hesitant customers how similar your documentation is across your different products.
  • Your support agents can easily see if they support documentation based on which product it applies to.

Creating Your Template

To create a template that will tell you what version of your software your documentation applies to:

  1. Go to Site Tools > Templates > Template:Custom > Views > New Page.


2.  Choose a title for your template. You will be using this title later.

3.  Paste the following DekiScript and CSS below using the correct styles for each. Then click save.

DekiScript (red box):

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>
  if (version == "V2")
      <span class="version-tag version-V2">
          <a class="F1 version-reference-link" href="#">"Only Version 2"</a>
  if (version == "both")
      <span class="version-tag version-both">
          <a class="F1 version-reference-link" href="#">"Version 1 and Version 2"</a>

CSS (blue box):

.version-indicator {
   border:1px solid #ccc;
.version-indicator span {
.version-indicator .version-text {

4. Edit the DekiScript to pertain to your product.

  1. Replace V1 with one version of your product, and replace V2 with another version of your product.
    • If you would like to add more versions paste the following DekiScript at the bottom of what you already have above the </div> tag:
if (version == "V3")
<span class="version-tag version-V3">
<a class="F1 version-reference-link" href="#">"Only Version 3"</a>
  1. If you would like the versions to link to a document explaining to the customer what product or version they are using, replace the href="#" with the path to that document.
    • For example:  /01MindTouch_4/MindTouch_4_Tools/What_version_of_MindTouch_am_I_using%3F

If you need help creating templates, click here.  

Adding Your Template to Documentation

To make your template show up on your site:

  1. Paste the following at the beginning of your document in a DekiScript style (red box):
template("Custom/Views/Template_Title", {version:"V1"});
  1. Replace "Template_Title" with the title of your template. Make sure to use an underscore (_) instead of a space.
  2. Replace "V1" with the version the document applies to. Make sure the name of the version has quotation marks around it. Keep in mind that two quotation marks by themselves ("") will refer to "Only Version 1," and "both" refers to "Version 1 and Version 2." 

What It Looks Like on Your MindTouch Site

Screen Shot 2014-07-03 at 11.30.31 AM.png