Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Create a new file in the SIL Manager called pageViewReport.sil
  2. Paste the following code into the file editor window:

    Code Block
    languagejava
    linenumberstrue
    struct table {
        string Title;
        string Views;
    }
    
    string cql = "(type=page and Space=" + argv[0] + ")";
    number [] pages = selectPages(cql);
    
    table [] tableData;
    
    for(number p in pages) {
        table t;
        t.Title = p.title;
        t.Views = getPersistentVar(p, "counter");
        tableData += t;
    }
    
    return tableData;


  3. Save the file
  4. On a new page add the SIL Table macro
  5. Edit the macro
  6. Select the pageViewReport.sil script for the script setting
  7. Add "Page, View Counts" into the columns setting
  8. Enter the key of the space the page is in for the input setting
  9. Save the macro
  10. Save the new page

...