Skip to main content

Implement basic dynamic controls (TCS)

This page applies to:MindTouch 4 and MindTouch TCS

Overview

DekiScript can be used to introduce dynamic controls to your knowledge.  This article provides an introduction to some of the basic DekiScript functions that are recommended for getting started. 

Sitemap Outline

A wiki.tree call can be used to put a hierarchical view of the current page and all sub-pages. To put it on the current page, use the following DekiScript in its own paragraph:

{{wiki.tree();}}

The wiki.tree call also accepts a number of parameters which allow you to modify the output.  The example above will output the sitemap for the entire site, however, if you wanted to output a sitemap with just one section of your hierarchy you could use the path parameter to confine the results to just on path of your site.

{{wiki.tree{path: "/Documentation"};}}

You can view our wiki functions page for a list of all wiki.tree parameters.

Table of Contents (TOC)

A wiki.toc call shows the headings on the current page in an outline list format. To put it on the current page, use the following text in its own paragraph:

{{wiki.toc();}}

Content Reuse

A wiki.page call displays content from a source page at the location of the call.  To utilize a wiki.page call, copy the following text and replace /Your/Source/Page with the actual source page path:

Keep in mind that the page path is everything in URL after the hostname. For instance, /Your/Source/Page is the path for the URL "https://yoursite.mindtouch.us/Your/Source/Page".

Wiki.page calls also have additional parameters that can be implemented to further refine the call.

Alphabetical Site Directory

A wiki.directory call shows all topics in your help system sorted alphabetically, and is great for a site map or other similar usage. To put the directory on the current page, use the following text in its own paragraph:

{{wiki.directory();}}

Page Author

The page.author calls displays the display name of the user who most recently edited the page.  This call is great to showcase content creators and encourage other users to maintain content.  To display the most recent page author simply add the following DekiScript to the page:

{{page.author.displayname;}}

Example

This page was edited by admin

Meta Description

The meta.description call allows authors to add a custom meta description tag to the page in the <head>.  The meta description tag is used by search engines to determine a description or summary of your page.  Having a meta description tag can help your search engine performance with some search engines.  A typical meta description tag (HTML) in the header looks like this:

<meta name="description" content="This will often show up in search results.">

You cannot directly modify content in the <head> of the HTML.  To modify your meta description simply add the following DekiScript to the page:

{{meta.description("This will often show up in search results");}}

For more information on <meta> tags please take a look at the Meta Functions.

Meta Keywords

The meta.description call allows authors to add a list of custom keywords as a <meta> tag in the HTML <head>.  The meta keywords tag is used by search engines to determine important search keyword.  Having a meta keywords tag can help your search engine performance with some search engines.  A typical meta keywords tag (HTML) in the header looks like this:

<meta name="keywords" content="API,Documentation,DekiScript">

You cannot directly modify content in the <head> of the HTML.  To modify your meta keywords simply add the following DekiScript to the page:

{{meta.keywords("API, Documentation, DekiScript");}}

For more information on <meta> tags please take a look at the Meta Functions.

  • Was this article helpful?