0

i add Mobile Status below is my code for cms block section it show out form section and i want to move it after status dropdown

protected function _prepareForm()
{
    $model = Mage::registry('cms_block');
    $form = parent::_prepareForm()->getForm();
    // $fieldset = $form->addFieldset('fieldset_cms', 
    array('legend'=>Mage::helper('core')->__('Mobile')));
        $form->addField('is_active_mobile', 'select', array(
            'name'      => 'is_active_mobile',
            'label'     => Mage::helper('cms')->__('Mobile Status'),
            'title'     => Mage::helper('cms')->__('Mobile Status'),
            'value'     => $model->getIsActiveMobile(),
            'class' => 'fieldset-wide',
            'required'  => true,
            'options'   => array(
                '1' => Mage::helper('cms')->__('Yes'),
                '0' => Mage::helper('cms')->__('No'),
            ),
     ));
     return $this;    
}

enter image description here

1

Try following code:


protected function _prepareForm()
{
    $model = Mage::registry('cms_block');
    $form = parent::_prepareForm()->getForm();
    $elem = $form->getElement('base_fieldset');
    $elem->addField('is_active_mobile', 'select', array(
        'name'      => 'is_active_mobile',
        'label'     => Mage::helper('cms')->__('Mobile Status'),
        'title'     => Mage::helper('cms')->__('Mobile Status'),
        'value'     => $model->getIsActiveMobile(),
        'class' => 'fieldset-wide',
        'required'  => true,
        'options'   => array(
            '1' => Mage::helper('cms')->__('Yes'),
            '0' => Mage::helper('cms')->__('No'),
        ),
    ), 'is_active');

    return $this;

}
  • great now how move after status – imtiaz Feb 15 '18 at 16:21
  • Check updated answer – Sohel Rana Feb 15 '18 at 16:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.