
[ "heh?", "Other", "Introducing the ForumTopic Template", "Tag Cloud" ]
So we've learned that an API-based approach won't work for our application, but we know that the API is the best (and sometimes only) way to get complete information about a page. Are we stuck? Of course not!
One thing we definitely can do is access the page variable and the page contents (via wiki.page() or page.xml) of other pages; we're already doing that with no problems, even on private pages. We can exploit this capability to solve our problem by embedding our desired information in the page contents. It would be preferable to do this automatically, with no user intervention. Thus we introduce the ForumTopic template.
Our goals for the ForumTopic template will be two-fold:
Update of Tag Cloud code is below. Changes made:
Basic tag display algorithm is completely unchanged.
| File | Size | Date | Attached by | |||
|---|---|---|---|---|---|---|
| content_xml No description | 3.04 kB | 20:10, 4 Sep 2008 | neilw | Actions | ||
/p/span, function 'map.keys' failed with response:
missing value for parameter 'map' (index 0)
This was because of pages with no tags.
Adding "if (#p.tags > 0) {" around the "foreach (var t in map.keys(p.tags)) ..." excludes pages with no tags.