xowiki::Page instproc www-popular-tags (public)

 <instance of xowiki::Page[i]> www-popular-tags

Defined in packages/xowiki/tcl/xowiki-www-procs.tcl

AJAX called function, returns an HTML snippet with the popular tags.

Partial Call Graph (max 5 caller/called nodes):
%3 _ _ (public) ad_script_abort ad_script_abort (public) ad_urlencode ad_urlencode (public) xowiki::Page instproc www-popular-tags xowiki::Page instproc www-popular-tags xowiki::Page instproc www-popular-tags->_ xowiki::Page instproc www-popular-tags->ad_script_abort xowiki::Page instproc www-popular-tags->ad_urlencode

Testcases:
No testcase defined.
Source code:
set package     ::${:package_id}
set limit       [:query_parameter limit:int32 20]
set weblog_page [$package get_parameter weblog_page:graph weblog]
set href        [$package pretty_link -parent_id [$package folder_id] $weblog_page]?summary=1

set entries [list]
xo::dc foreach get_popular_tags  [::xo::dc select  -vars "count(*) as nr, tag"  -from "xowiki_tags"  -where "item_id = [ns_dbquotevalue ${:item_id}]"  -groupby "tag"  -orderby "nr"  -limit $limit] {
           set label [ns_quotehtml "$tag ($nr)"]
           lappend entries "<a href='[ns_quotehtml $href&ptag=[ad_urlencode $tag]]'>$label</a>"
         }
ns_return 200 text/html "<span class='popular-tags'>[_ xowiki.popular_tags_label]: [join $entries {, }]</span>"
ad_script_abort
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: