Skip to main content
MindTouch Success Center

DekiScript 101

Written by Miller Saltzman
Former Employee at MindTouch
This page applies to:MindTouch (current)

New to MindTouch and have no idea how to use DekiScript? This article introduces the basics of DekiScript, the MindTouch programming language.
 

Why DekiScript?


  • Provides an easier, more controlled experience for writing HTML than using the source view mode.
  • Allows you to personalize your site by showing different content depending on who is using your site.
  • Offers opportunities to dynamically display content.
     

What can I write with DekiScript?


Just like with other programming languages, you can use the following with DekiScript to define your content:

How to add DekiScript to a page


MindTouch has a formatting block just for DekiScript, if the code is not inside that block then the DekiScript will not be executed. You can generate these blocks within the editor in a few simple steps:

  1. Open the page in Edit mode.
  2. Add a DekiScript code block and write your code.
  3. Save your page.

Receiving an error message?


If the computer cannot understand your DekiScript, a bright red message lets you know the location of the invalid code:

"}" expected: /content/body/pre[2], line 5, column 1  


This is the DekiScript that led to the above error:

var x =25;
if (user.title != "How to Use DekiScript for Programmers")
{
"If you are a programmer look at this link instead:"
let x = 75;
}
<br/>
<br/>
x;

The error message states that error is in the fifth line of DekiScript. The number column states how many symbols into the line (count from left to right) the error occurs.

When the column number is 1,  the mistake usually occurred at the end of the previous line.

 

Test yourself


Can you figure out what the issue is in the above example?  

►  Answer
Yes, you got it. The semicolon at the end of line 4 is missing!
 

Check your code


  • Did you remember to type a semicolon at the end of every line?
  • Did you remember to put quotation marks around every line of text?
     

What's next


Learn how to work with the most common DekiScript definitions and operators

 

  • Was this article helpful?