Forum Academy Marketplace Showcase Pricing Features

Creating dynamic options in option sets

I’m trying to create a feature in my app which will allow an admin to create categories for certain content (example: when you create a blog post, you can categorise it as “tech” or “art” etc.). For this, I’m using option sets. I created an option set called category types and under this every option created will be a category available to users to tag their content with.

However, I need to able to create these categories from an admin panel, instead of going into data->option sets->select option set->add option

Is there a way to do this ? Or is there any way around this that can achieve the same functionality? I could just store categories as a list of text, but if an admin decides to delete a particular category, it will cause problems on all content tagged with that category

Thanks

As you have discovered, Option Sets are for a fixed number of items, you can’t create them dynamically.

You need to create a Data Type for your categories. For a basic setting you just need a Name field, and then add a Categories field to your Posts with Field Type: Category(list) to store the post’s categories.

This topic was automatically closed after 70 days. New replies are no longer allowed.