I’m making an attempt to programmatically create beans in a customized module utilizing entity_metadata_wrapper. That is making a bean for every put in theme. (In Drupal 7)
Is there a means I can create just one occasion of Drupal Development Company bean block?
for instance in my database it creates a bean block for
- my subtheme
- omega
- seven
I wish to solely create one block/bean for my subtheme. I’m then utilizing mymodule_beans_block_info_alter(&$blocks, $theme, $code_blocks) {} to then change area location and different block parameters.
perform bean_ctas_enable(){ foreach(bean_ctas_info() as $bean_content){ $bean_ids = array(); $bean = bean_create(array('sort' => 'block_cta')); $bean_wrap = entity_metadata_wrapper('bean', $bean); $bean_wrap->label->set($bean_content['label']); $bean_wrap->title->set($bean_content['title']); $bean_wrap->field_text->set(array( 'worth' => ($bean_content['field_text']), 'format' => ('full_html'), )); $bean_wrap->field_link->set(array( 'url' => ($bean_content['link_url']), 'title' => 'Learn Extra', )); $bean_wrap->save(); $bean_ids[] = $bean_wrap->bid->worth(); //set variable to retailer bean ids variable_set('bean_ctas_bean_ids', $bean_ids); } }