How to create dropdown select type category attribute programmatically in magento 2?

Magento 2, You can create a custom category attribute with a list of CMS blocks in the dropdown field.

The module is simply residing in the app/code folder of the Magento instance.

For example, We kept the Package name as Rbj and the Module name as CategoryAttribute.
You can keep any name for Packagename/Module name. In our demo, we have kept the Module name as Rbj_CategoryAttribute.

2 Replies to “How to create dropdown select type category attribute programmatically in magento 2?”

  1. Hello,

    Thanks for sharing this useful and well-detailed guide.

    Well, I think there is a slight typo mistake in CLI commands, bin/magento is missing. The commands would have to be like this:

    php bin/magento setup:upgrade
    php bin/magento setup:static-content:deploy -f
    php bin/magento cache:flush

Comments are closed.