By default Articulate allows the author to create new categories on the fly when they add a new blog post. I want to avoid this and force them to choose from a predefined list. The author can then choose one or more of these categories that are related to their post. This is to make filtering and searching via the categories more straightforward and manageable. The tag feature will still exist for more specific categorization.
Is there a way to set a fixed list using the current Data Type or do I need to create a new one, such as a Checkbox list?
I haven't tried but you might be able to just the tag data type on the categories property to a checkbox list - just depends on how the data is saved (i.e. csv).
The other problem is that any APIs that articulate uses to query for categories (i.e. TagQuery on the UmbracoHelper) looks in the db tags table (since a category is just a tag). So it depends on your template and it's usage of categories.
Another option would be to have an event handler on the ContentService.Saving event where you could check if the item being saved is a blog post item, check the categories it contains and remove any non-approved categories.
Another option would be to create your own property editor that is attributed with the [SupportTags] - this could be a check box list or whatever but would ensure that the tags db table is populated with the values.
Thanks for the response. I will look to implement option 1. I'll write some custom queries to ensure I don't need to utilize the helper methods for this and will post my outcomes here when I'm done. Cheers.
Predefined categories
By default Articulate allows the author to create new categories on the fly when they add a new blog post. I want to avoid this and force them to choose from a predefined list. The author can then choose one or more of these categories that are related to their post. This is to make filtering and searching via the categories more straightforward and manageable. The tag feature will still exist for more specific categorization.
Is there a way to set a fixed list using the current Data Type or do I need to create a new one, such as a Checkbox list?
Thanks in advance.
Nathan
I haven't tried but you might be able to just the tag data type on the categories property to a checkbox list - just depends on how the data is saved (i.e. csv).
The other problem is that any APIs that articulate uses to query for categories (i.e. TagQuery on the UmbracoHelper) looks in the db tags table (since a category is just a tag). So it depends on your template and it's usage of categories.
Another option would be to have an event handler on the ContentService.Saving event where you could check if the item being saved is a blog post item, check the categories it contains and remove any non-approved categories.
Another option would be to create your own property editor that is attributed with the [SupportTags] - this could be a check box list or whatever but would ensure that the tags db table is populated with the values.
Hi Shannon,
Thanks for the response. I will look to implement option 1. I'll write some custom queries to ensure I don't need to utilize the helper methods for this and will post my outcomes here when I'm done. Cheers.
is working on a reply...