site.categories()
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'}]
|

