Description Usage Arguments Details Examples
Work with categories
1 2 3 4 5 6 7 8 9 10 11 12 13 | categories(url = NULL, key = NULL, user = NULL, ...)
category(category, url = NULL, key = NULL, user = NULL, ...)
category_latest_topics(category, url = NULL, key = NULL, user = NULL, ...)
category_top_topics(category, url = NULL, key = NULL, user = NULL, ...)
category_new_topics(category, url = NULL, key = NULL, user = NULL, ...)
category_create(category, color, text_color, description = NULL,
permissions = NULL, parent_category = NULL, url = NULL, key = NULL,
user = NULL, ...)
|
url |
Base url for a Discourse installation. See
|
key |
Your api key on the Discourse installation. See
|
user |
Your user name on the Discourse installation. See
|
... |
Named parameters passed on to |
category |
Category name. required |
color |
A color by name or hex string. optional |
text_color |
A color by name or hex string. optional |
description |
Description of the category. optional |
permissions |
Permissions - a list with the group name and permission_type which is an integer: 1 = Full, 2 = Create Post, 3 = Read Only. optional |
parent_category |
x. optional |
Apprently there's no ability to delete categories via the API.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ## Not run:
# all categories
categories()
# a specfic category
category("questions")
category("packages")
# latest topics for a category
category_latest_topics("packages")
# top topics for a category
category_top_topics("packages")
# new topics for a category
category_new_topics("packages")
# create a category
category_create("stuff3", "F7941D", "FFFFFF", "My new category")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.