Skip to content

Programmatically Create Taxonomy Record #16680

Answered by douwinga
thatplatypus asked this question in Q&A
Discussion options

You must be logged in to vote

You could look at the TagController to get an idea on how to create terms for existing taxonomies. You would probably need your own controller since this built in controller is using the [Admin] attribute, but this should get you started on how to do this as this is how the admin ui does it.

public async Task<IActionResult> CreatePost(string taxonomyContentItemId, string displayText)

Terms are just content items, so you can Alter the content item with whatever values you need to handle things like "Specials"

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@douwinga
Comment options

Answer selected by thatplatypus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants