site.categories()
view-source14x14.png

Purpose

Method site.categories() retrieves the names of all categories in a site.

Syntax

site.categories({'site': 'site-name'})

Arguments

site-name
the name of the site, whose categories to list

Returns

All categories defined on http://site-name.wikidot.com are returned as a list of dictionaries with the following key:

'name'
The category's name; '_default' for the default category

Note that the categories are returned in an arbitrary order. To sort the returned list, see the Sort Returned Data snippet.

Example

The example assumes that s is a successfully authenticated ServerProxy object.

What you type … What you get …

s.site.categories({'site': 'xml-api'})

[{'name': 'doc'},
{'name': 'admin'},
{'name': '_default'},
{'name': 'search'},
{'name': 'system'},
{'name': 'nav'}]

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License