Skip to main content

List recently modified articles targeting specific tags

This page applies to:MindTouch Responsive

This tutorial provides instruction on how to create a DekiScript template to dynamically list the ten most recent articles with a specific tag. With help of this tutorial you may, for example, display a list of featured articles on your homepage or drafts on a contributor page. 



Depending on the articles you want to surface, the MindTouch default classifications may not suffice. Use custom classifications to control which articles to surface.

Create your template

In order to get started, you first need to create a new template:

  1. Navigate to Site toolsDashboard > Content management Template directory (/Template:).
  2. Navigate to Template:Custom.*

IMPORTANT!  DO not modify or add any templates in Templates:MindTouch.

  1. Click New.
  2. Select Blank page.
  3. Save the page as TaggedArticlesWidget.

* For this example, we assume your template is located at /Template:Custom/TaggedArticlesWidget

Add DekiScript to your template

Now that you have created a new template, you are ready to add the DekiScript code block to your page. Perform the following steps:

  1. Open your TaggedArticlesWidget template in Edit mode.
  2. In the editor toolbar, click the Styles drop-down list and select DekiScript.


  1. Paste the following into the DekiScript code block:
var query = "tag:stage:draft";
var pages = wiki.getSearch(query, 10, "-date");

<div class="widget-tagged-articles">
        foreach (var pg in pages)
                <a href=(pg.uri)>pg.title</a>
                <span class="date">
                    "( edited ";
                        date.format(,"ddd MMM dd, yyyy");
                    " )"


  1. Locate the var query


  1. Modify the var query to reflect the classification and tag of articles you want to display (e.g. replace "tag:stage:draft" with your own classification "tag:language:english" ).

NOTE:  You must specify both the classification and tag, or the code will not return any results.​ If you are unsure, review your classifications and tags in the control panel (under System Settings > Classifications).

  1. Click Save.

(Optional) Customize the look and feel of your template

Now that you have created your template and added the DekiScript, you have the option to customize the way the date is displayed in your list. Perform the following to add CSS to your template:

  1. Open your TaggedArticlesWidget template in Edit mode.
  2. Insert the cursor at the bottom of th page. Tip:  If the cursor only shows up in the DekiScript block, press Shift Enter to escape it. 
  3. In the editor toolbar, click the Styles drop-down list and select CSS.


  1. Paste the following into the CSS code block:
.widget-tagged-articles .date{
    margin:0 0 0 5px;
    font-style: italic;


  1. Modify the CSS as desired. 
  2. Click Save.

Add your template to a page

Now that your template is complete, you're ready to embed it into a MindTouch page. While most users will find this information valuable on your homepage, you may embed your template into any MindTouch page:

  1. Navigate to the page on which you want to display the list.
  2. On the MindTouch toolbar, click Edit.
  3. Locate where on the page you want to add the widget (even in a table, if you want).
  4. Add the following DekiScript and click Save.



*There is a known issue with this tutorial returning duplicate results. This issue is currently being resolved.
  • Was this article helpful?