I hit my head to add a simple and simple website link on a custom grid column. I used Inchoo's blog to add a custom renderer for the column, and it works. I, however, simply change the visualization and add a tag. But my hopes were broken, not working.
How can I do that? It should be simple, but I just can’t find how to do it. I found a lot of questions / answers here in SO, but about adding links to products, categories, etc., Links to external websites, maybe I'm just using the wrong keywords in the search.
Here is _prepareColumns () from my Grid.php
protected function _prepareColumns() { $blog = Mage::getModel('blogtest/blog'); $this->addColumn('api_blog_url', array( 'header' => $this->__('URL'), 'align' => 'center', 'index' => 'api_blog_url', 'width' => 50, 'type' => 'text', 'renderer' => 'Dts_Blogtest_Block_Adminhtml_Blog_Renderer_MyRender' )); ....
And here is my override override for this column:
<?php class Dts_Blogtest_Block_Adminhtml_Blog_Renderer_MyRender extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract { public function render(Varien_Object $row) { $value = $row->getData($this->getColumn()->getIndex());
source share