Skip to main content

View recently modified pages (TCS)


The below method will lower customer effort by providing multiple access points that can be used to view the most recently modified articles on your site. By leveraging the MindTouch API and DekiScript, you will create a page that lists all of your site's most recently updated articles. You can then output the content of this page across all of your customer engagement channels.

Here's a way to achieve this through using MindTouch to create a recently modified pages document with Dekiscript, and then reading the page contents API for the rendered document. 

Build a collection of recently modified pages

Create a collection of DekiScript page objects that represent recently modified pages. There are different ways to build this collection depending on your needs. 

// the top 10 most recently modified pages for the entire site
var pages = wiki.getpagestrendstats('', 10, true).recentlyupdated;


// top 20 most recently modified pages for a specific guide or category
var pages = wiki.getpagestrendstats('Documentation/Scripting', 20, true).recentlyupdated;

or ...

// top 5 most recently modified pages for a specific page and its immediate subpages only
var pages = wiki.getpagestrendstats('Documentation', 5, false).recentlyupdated;

Create a recently modified pages document

Iterating over the collection of DekiScript page objects allows a Developer to render page metadata in markup. Since we will be fetching this content via an API, it does not need to necessarily be valid HTML.

foreach(var page in pages) {
    <page id=(>
        // ... more data is available in the page object. use only what you need however, fetching tags, properties, or
        // any other property whose value is preceded with $get_ will have to go back to a data source to fetch that
        // information. fetching more data than is absolutely necesssary will have adverse effects on this solution's
        // performance

Fetch the recently modified pages document

The above example DekiScript is located on an example subpage to this article. The rendered document can be fetched via HTTP GET at the following location:

Wherever you ultimately place this code on your domain, grab the URL path ({scheme}://{domain}/{path}), double URL encode it, and use the page contents API to fetch it like so from your domain: {scheme}://{domain}/@api/deki/pages/={path}/contents?format=xhtml.

Without the format query parameter set, the content will be HTML entity encoded. Try the request with or without the format query parameter to determine which you prefer for consumption. With the format query parameter set to xhtml, the output of the above example looks like:


Without the format query parameter set, the above example looks like:



Enhance with APIs (MT4)Documentation/MindTouch4/Scripting/Enhance_with_APIs, 27 Apr 2016 04:29:29 GMTEnhance with DekiScript (MT4)Documentation/MindTouch4/Scripting/Enhance_with_DekiScript, 12 Nov 2015 20:43:01 GMTEnhance with global variables (MT4)Documentation/MindTouch4/Scripting/Enhance_with_global_variables, 04 Nov 2015 01:07:01 GMTScripting: Best Practices (MT4)Documentation/MindTouch4/Scripting/Best_practices, 25 Oct 2015 07:28:10 GMTScripting: FAQs (MT4)Documentation/MindTouch4/Scripting/FAQs, 22 Oct 2015 23:26:26 GMT
  • Was this article helpful?