Template:MostPopularPages

    Table of contents
    No headers
    /***
        USAGE:
    
            MostPopularPages()
                show top 10 most popular sub-pages of the current page.
    
            MostPopularPages(PAGES)
                show top 10 most popular pages from the PAGES list.
    
            MostPopularPages(PAGES, LIMIT)
                show top LIMIT most popular pages from the PAGES list.
    ***/
    
    var pages = $0 ?? $pages ?? page.subpages;
    var limit = $1 ?? $limit ?? 10;
    
    if(#pages) {
        <font size="-1">
            <ol>
                foreach(var p in list.sort(map.values(pages), 'viewcount', true) where __count < limit) {
                    <li>web.link(p.uri, p.title)</li>
                }
            </ol>
        </font>
    }
    

     

    Tag page
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by