Skip to main content
MindTouch Success Center

Customize tabs (MT4)

This page applies to:MindTouch 4


This document explains how to create your own tabs for the tabs interface that appears on certain MindTouch 4 articles that act as navigation pages. After completing this how-to, you will have created your own tabs for the tabs interface.

custom_tabs.png

Your custom tabs include the custom labels you configure to appear on the tab itself, as well as custom content that appears when a user clicks the tab. Custom tabs can be added to user guides, though this is not available within knowledge bases. You have three options for what appears when a user clicks a tab:

  • Using a page as a tab - You can create a regular MindTouch article and create static content to appear on the tab there. You specify the path of the MindTouch article to use and the system shows the contents of that page when the user clicks the tab.
     
  • Basing a tab on a new value for the Article Type field - Similar to how the user guide tabs interface shows the pages in the section with the Article Type of TopicHow-To, or Reference, you can create a new classification and create a tab that shows articles with that Article Type.
     
  • Basing a tab on a value for a new classification - Just as you can create new values for the Article Type field, you can create entirely new classifications and values for those classifications. Then you can create a tab that shows articles with a particular value in that classification.
     

Article types are classifications. Create new article types as you would any other custom classification. For more information on custom classifications, read our article on creating custom classifications


Using a page as a tab


Use the following steps to create a custom tab where the content of the tab is the content of another MindTouch article:

  1. Create a page that  you want to appear when the user clicks the tab. Note the URL of the page.

If you don't want users to navigate to this page except as a tab, you can use the restrict access screen to make the page Semi-Private. Do not make the page Private - it won't appear on the tab to users who don't have permissions.

  1. Edit the page where you want to include the tabs interface.

If you expect to use the custom tabs in many pages, you can create a template and complete the steps in that template instead. Then you can insert the template on any page where you need the custom tabs.

  1. Place your cursor where you want the tabs interface to appear and choose DekiScript from the Styles menu on the toolbar:

    insert_dekiscript.png
     
  2. Insert the following DekiScript:
  • TabName is the word you want to appear on the tab
  • /path is the location of the page from step 1. Do not include the domain in this path. For example, if the URL of the page is https://example.mindtouch.us/tab, you would enter /tab here.
template('MindTouch/IDF2/Views/Guide',{
    tabs:[     
        {title: "TabName", path: "/path"}
    ]
});


Basing a tab on a new value for the Article Type field


Before you can complete this procedure, you must modify the values for the Article Type classifications. You must set at least one article to this article type before any information can appear in the tab.

Use the following steps to create a custom tab where the content of the tab is determined by an article type that you created:

  1. Edit the page where you want to include the tabs interface.

If you expect to use the custom tabs in many pages, you can create a template and complete the steps in that template instead. Then you can insert the template on any page where you need the custom tabs. 

  1. Place your cursor where you want the tabs interface to appear and choose DekiScript from the Styles menu on the toolbar.

insert_dekiscript.png
 

  1. Insert the following DekiScript. Where:
  • TabName is the word you want to appear on the tab
  • NewType is the name of the custom article type you created previously during the creation of your custom classification.
template('MindTouch/IDF2/Views/Guide',{
    tabs:[    
        {title: "TabName", articletype: "tag:NewTag"}
    ]
});

You can only tag articles that are contained in the guide your are working with. Remember the hierarchy: category > guide > article. 


Basing a tab on a value for a new classification


Before you can complete this procedure, you must create a custom  classification. You must set the classification of at least one article to the value in the code below before any information can appear in the tab.

Use the following steps to create a custom tab where the content of the tab is determined by the value in a classification that you created:

  1. Edit the page where you want to include the tabs interface.

If you expect to use the custom tabs in many pages, you can create a template and complete the steps in that template instead. Then you can insert the template on any page where you need the custom tabs.  

  1. Place your cursor where you want the tabs interface to appear and choose DekiScript from the Styles menu on the toolbar:

    insert_dekiscript.png
     
  2. Insert the following DekiScript:
  • TabName is the word you want to appear on the tab
  • FieldName is the name of the custom classification you created previously during the Setting Up Classifications procedure.
  • FieldValue is the value of the custom classification you created during the Setting Up Classifications procedure.
template('MindTouch/IDF2/Views/Guide',{
    tabs:[    
        {title: "TabName", articletype: "FieldName:FieldValue"}
    ]
});


Mixing tab types


The examples on this page show just one custom tab apiece, but you can:

  • Include multiple of the same type of tab in a tabs interface
  • Mix the types of tabs in the same interface
  • Place custom tabs alongside the standard tabs 

For example, the following DekiScript creates a tabs interface with the three standard Topic, How To, and Reference tabs along with one each of the custom tab types listed in this article:

template('MindTouch/IDF2/Views/Guide',{
    tabs:[    
        {title: "Topic", articletype: "topic"},
        {title: "How To", articletype: "how-to"},
        {title: "Reference", articletype: "Reference"},
        {title: "Page", path: "/page"},
        {title: "NewArticleType", articletype: "article:NewType"},
        {title: "NewField", articletype: "FieldName:FieldValue"}
    ]
});

 

What's next


If you need further assistance with custom tabs, contact MindTouch Support.

  • Was this article helpful?