Skip to main content
MindTouch Success Center

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:



DekiScript ObjectsSolutions/Product_Documentation/MindTouch_Tools_and_Features/DekiScript_Documentation/DekiScript_Objects, 14 Mar 2017 14:12:14 GMTDekiScript FunctionsSolutions/Product_Documentation/MindTouch_Tools_and_Features/DekiScript_Documentation/DekiScript_Functions, 14 Mar 2017 14:12:07 GMTUse DekiScriptSolutions/Product_Documentation/MindTouch_Tools_and_Features/DekiScript_Documentation/Use_DekiScript, 14 Mar 2017 14:11:33 GMT
  • Was this article helpful?