1)managedesign is my custom module
2) /app/code/local/Managedesign/Managedesign/Block/Adminhtml/Managedesign/Grid.php
call rander method:
"design_id" ia a database attribut;
$this->addColumn("design_id", array(
"header" => Mage::helper("managedesign")->__("Link"),
"index" => "design_id",
'renderer' => 'managedesign/adminhtml_managedesign_renderer_image'
));
3)crerate a folder Renderer and make a file Image.php
/app/code/local/Managedesign/Managedesign/Block/Adminhtml/Managedesign/Renderer/Image.php
class Managedesign_Managedesign_Block_Adminhtml_Managedesign_Renderer_Image extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract{
public function render(Varien_Object $row)
{
$html = '<img width="105" height="15" ';
$html .= 'id="' . $this->getColumn()->getId() . '" ';
$html .= 'src="' . Mage::getBaseUrl('web').'customizer/designs/'.$row->getData($this->getColumn()->getIndex()) . '_FRONT.png"';
$html .= 'class="grid-image ' . $this->getColumn()->getInlineCss() . '"/>';
$html .= '<br/><p><a href="'.$row->getData($this->getColumn()->getIndex()).'">Downlode Design</a></p>';
return $html;
}
}
2) /app/code/local/Managedesign/Managedesign/Block/Adminhtml/Managedesign/Grid.php
call rander method:
"design_id" ia a database attribut;
$this->addColumn("design_id", array(
"header" => Mage::helper("managedesign")->__("Link"),
"index" => "design_id",
'renderer' => 'managedesign/adminhtml_managedesign_renderer_image'
));
3)crerate a folder Renderer and make a file Image.php
/app/code/local/Managedesign/Managedesign/Block/Adminhtml/Managedesign/Renderer/Image.php
class Managedesign_Managedesign_Block_Adminhtml_Managedesign_Renderer_Image extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract{
public function render(Varien_Object $row)
{
$html = '<img width="105" height="15" ';
$html .= 'id="' . $this->getColumn()->getId() . '" ';
$html .= 'src="' . Mage::getBaseUrl('web').'customizer/designs/'.$row->getData($this->getColumn()->getIndex()) . '_FRONT.png"';
$html .= 'class="grid-image ' . $this->getColumn()->getInlineCss() . '"/>';
$html .= '<br/><p><a href="'.$row->getData($this->getColumn()->getIndex()).'">Downlode Design</a></p>';
return $html;
}
}
Comments
Post a Comment