2

I've received the following request from some of the admin users:

When viewing the products list (The Manage Products screen), they want products to open in a new tab when clicking on them to edit.

I'm not sure if it's as simple as setting target="_blank" somewhere or if it's more complex, I honestly am not sure where to start.

Can someone please help me or at least point me in the right direction, please?

1 Answer 1

3

Tell them to use middle mouse click for new tab :D.
Now seriously, the edit link is generated in the method Mage_Adminhtml_Block_Catalog_Product_Grid::_prepareColumns with this code:

 $this->addColumn('action', array( 'header' => Mage::helper('catalog')->__('Action'), 'width' => '50px', 'type' => 'action', 'getter' => 'getId', 'actions' => array( array( 'caption' => Mage::helper('catalog')->__('Edit'), 'url' => array( 'base'=>'*/*/edit', 'params'=>array('store'=>$this->getRequest()->getParam('store')) ), 'field' => 'id' ) ), 'filter' => false, 'sortable' => false, 'index' => 'stores', )); 

if you make the actions section look like this

 'actions' => array( array( 'caption' => Mage::helper('catalog')->__('Edit'), 'url' => array( 'base'=>'*/*/edit', 'params'=>array('store'=>$this->getRequest()->getParam('store')) ), 'field' => 'id', 'target' => '_blank' ) ), 

You should get it to open in a new tab.
But don't edit the code. Just rewrite the method.

2
  • Thanks! Just a heads up, isn't it 'target'=>'_blank'? Commented Nov 24, 2016 at 13:28
  • 1
    Yep. You are right. I edited the answer. Thanks. Commented Nov 24, 2016 at 13:29

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.