I want to display the static block list in magento admin product creation page.
I referred this link http://www.milessebesta.com/web-design/magento-use-custom-product-attributes-to-add-cms-static-block-to-product-page/
But it shows manual entry of static block names in custom options.
I want to show the static block option list dropdown as dynamic.
Magento 1.9 – Display Static Block List in Drop Down on Create Product Page
cms-blockmagento-1.9productstatic-block
Best Answer
You can find here and explanation of how you can add a product attribute with a custom source model.
The idea is to add a simple attribute like any others (via an install script) and fill in the field
source_model
with the alias of a model.This way, when the options are retrieved, the method
getAllOptions
from the source model class is called. And that method can contain anything.In your case, you just need to change in the example I linked the method
getAllOptions
and make it look like this: