Tag manipulation and assignment functions
Usage
get_tags(src)
get_tag_data(src)
create_tag(src, name, parent = NULL)
create_tag_tree(src, ...)
delete_tag(src, tag)
get_content_tags(content)
set_content_tag_tree(content, ...)
set_content_tags(content, ...)
filter_tag_tree_id(tags, ids)
filter_tag_tree_chr(tags, pattern)Arguments
- src
The source object
- name
The name of the tag to create
- parent
optional. A
connect_tag_treeobject (as returned byget_tags()) pointed at the parent tag- ...
Additional arguments
Manage tags (requires Administrator role):
get_tags()- returns a "tag tree" object that can be traversed withtag_tree$tag1$childtagget_tag_data()- returns a tibble of tag datacreate_tag()- create a tag by specifying the Parent directlycreate_tag_tree()- create tag(s) by specifying the "desired" tag tree hierarchydelete_tag()- delete a tag (and its children). WARNING: will disassociate any content automatically
Manage content tags:
get_content_tags()- return aconnect_tag_treeobject corresponding to the tags for a piece of content.set_content_tag_tree()- attach a tag to content by specifying the desired tag treeset_content_tags()- Set multiple tags at once by providingconnect_tag_treeobjects
Search a tag tree:
filter_tag_tree_chr()- filters a tag tree based on a regexfilter_tag_tree_id()- filters a tag tree based on an id
- tag
A
connect_tag_treeobject (as returned byget_tags())- content
An R6 Content object, as returned by
content_item()A
connect_tag_treeobject (as returned byget_tags())- ids
A list of
ids to filter the tag tree by- pattern
A regex to filter the tag tree by (it is passed to
grepl)