Friday, December 10, 2010

Adding TInyMCE Editor in Magento Custom Module

I've created an custom module from module creator but i couldnot displayed tinymce wysiwyg editor in admin page ?

though modulecreator guys has added default field of "content" for editor:

$fieldset->addField('contentdesc', 'editor', array(
'name' => 'contentdesc',
'label' => Mage::helper('getthelooks')->__('Description'),
'title' => Mage::helper('getthelooks')->__('Description'),
'style' => 'width:500px; height:300px;',
'config' => Mage::getSingleton('cms/wysiwyg_config')->getConfig(),
'wysiwyg' => true,
'required' => true,
));

but even i change wysiwyg to true it didnt worked. module creator has forgot that to enable wysiwyg we also needed js for that

so here is complete simple layout xml file :





1










js_cssprototype/windows/themes/default.css
js_cssprototype/windows/themes/magento.css










change getthelooks to your custom module name and enjoy!

Product grid Magento

$this->getLayout()->createBlock('adminhtml/catalog_product_grid', 'product.grid')->toHtml()

GET ATTRIBUTE VALUE MAGENTO

if($_product->getResource()->getAttribute('webexcusive')->getFrontend()->getValue($_product) == 'Yes') {

Tuesday, December 7, 2010

Magento Print your Static BLOCK

getLayout()->createBlock('cms/block')->setBlockId('BLOCK IDENTIFIER')->toHtml() ?>

Monday, December 6, 2010

select box

function createDuplicateSelectbox(selobj){
selectcount = selectcount +1;
var string1='