Skip to main content
NICE CXone Expert
Expert Success Center

Popular pages list in DekiScript

Embed a custom-styled list of the top ten popular articles into an Expert page.

Part 1: Create template

  1. Navigate to Site Tools > Dashboard > Site Administration > Template Directory.
  2. From the Expert Toolbar, select New.
  3. Enter a name for the template in the Template:Page Title field, for example, "Popular Pages".
  4. From the Editor Toolbar, select Style > DekiScript.
  5. In the Enter Dekiscript field, paste the following DekiScript code:
    var uri = site.api & 'pages/popular' & { limit: 10 };
    var api = wiki.api(uri);
    <div class="widget-popular">
        foreach(var pg in api['page'] ) {
       / 'uri.ui', pg / 'title');
                var viewcount = num.cast(pg / 'metrics/metric.views');
                <span class="viewcount">
                    " (";
                    " views)";
  6. To customize the style of the template (optional), select Style > CSS from the Editor Toolbar and enter custom CSS into the field. For example:
    .widget-popular .viewcount {
        margin:0 0 0 10px;
  7. Click Save and you will see the DekiScript block and CSS block (optional) in view mode.

Part 2: Embed template on Expert page

  1. Navigate to the page where you want the template embedded and open it in Edit Mode.
  2. Place your cursor in the desired page location and select Style > DekiScript.
  3. In the Enter Dekiscript field, paste the following DekiScript code, making sure that the text in quotes matches your template URL:
  4. Click Save.

Example with page view count



  • Was this article helpful?