Soy muy nuevo en Magento
, recién empecé Magento antes de 4 días, pero tengo la tarea de desarrollar una Magento extension
. Así que estoy leyendo en internet y lo estoy creando.
Ahora, el problema que tengo es que quiero agregar tabs de la barra lateral izquierda personalizada al igual que está debajo
System->Configuration
.
Lo he intentado mucho pero sin éxito. Por favor, ayúdame.
Aquí está mi config.xml
0.1.0 standard Gwb_Magecrmsync magecrmsync adminhtml.xml admin Gwb_Magecrmsync magecrmsync Synchronize 999 Customers Orders Products Gwb_Magecrmsync_Model Magecrmsync_mysql4 default_setup default_write default_read Gwb_Magecrmsync_Block Gwb_Magecrmsync_Helper adminhtml.xml
Por favor, dime dónde me falta algo que no me permita agregar tabs a la izquierda en mi página personalizada. Por favor, corrígeme si estoy equivocado en cualquier lugar.
Editar
Este es mi archivo system.xml. Esto me permite agregar una pestaña personalizada en Sistema-> Configuración, pero quiero que esté en mi página personalizada, que está separada del Menú de configuración.
200 separator-top sidetab 100 1 1 1 text 10 1 1 1 select adminhtml/system_config_source_yesno 1 1 1 1 select adminhtml/system_config_source_yesno 1 1 1 1 select adminhtml/system_config_source_yesno 1 1 1 1
Mi código de controlador:
loadLayout() ->_setActiveMenu('menu1') ->_addBreadcrumb(Mage::helper('adminhtml')->__('Synchronize Data'), Mage::helper('adminhtml')->__('Synchronize Data')) ->_title($this->__('Synchronize Data')); $block = $this->getLayout()->createBlock( 'Mage_Core_Block_Template', 'my_block_name_here', array('template' => 'magecrmsync/mainblock.phtml') ); $this->getLayout()->getBlock('content')->append($block); $this->renderLayout(); } }
Quiero agregar tabs en mi página así:
.”>
Cualquier ayuda sería muy apreciada y me será útil.
Gracias Ravinder
Parece que estás intentando crear un bloque ‘izquierdo’ y ‘principal’ dentro de tu controlador de administración.
$this->loadLayout(); $this->_addContent($this->getLayout()->createBlock('form/adminhtml_form_edit')) ->_addLeft($this->getLayout()->createBlock('form/adminhtml_form_edit_tabs')); $this->renderLayout(); class Excellence_Form_Block_Adminhtml_Form_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs { public function __construct() { parent::__construct(); $this->setId('form_tabs'); $this->setDestElementId('edit_form'); // this should be same as the form id define above $this->setTitle(Mage::helper('form')->__('Product Information')); } protected function _beforeToHtml() { $this->addTab('form_section', array( 'label' => Mage::helper('form')->__('Item Information'), 'title' => Mage::helper('form')->__('Item Information'), 'content' => $this->getLayout()->createBlock('form/adminhtml_form_edit_tab_form')->toHtml(), )); return parent::_beforeToHtml(); } }
Consulte http://www.excellencemagentoblog.com/module-development-series-magento-admin-module-part3
$this->_addLeft($this->getLayout() ->createBlock('core/text') ->setText('Left Block
')); $block = $this->getLayout() ->createBlock('core/text') ->setText('Main Block
'); $this->_addContent($block);
Leí su pregunta rápidamente en mi respuesta anterior, así que agregaré esta nueva con la información correcta. Tendrá que hacer una estructura de carpetas, en la que las tabs estén separadas en diferentes archivos.
El siguiente enlace explica cómo agregar una pestaña a un módulo existente, es posible que desee buscar un artículo mejor, ya que hay suficiente información sobre este tema: http://terrani.wordpress.com/2011/01/ 03 / magento-add-a-new-tab-on-customer-edit-page /
Otro artículo al respecto: http://www.atwix.com/magento/new-tab-product-edit-page/