Open pboethig opened 8 years ago
Peter,
It should work just as any other WYSIWYG. Are you having trouble utilizing Magento's editor to insert a widget's code into the contents of the entity's attribute, or is the trouble with rendering the widget on output to screen?
Sent from my Sprint Samsung Galaxy S® 6.
-------- Original message -------- From: pboethig notifications@github.com Date: 12/30/2015 6:26 AM (GMT-06:00) To: "tzyganu/UMC1.9" UMC1.9@noreply.github.com Subject: [UMC1.9] How can i use insert widget function on wysiwyg mode of a textarea? (#112)
Hi,
If enable wysiwyg i cant insert a widget How can I enable that?
Kind regards
peter
Reply to this email directly or view it on GitHubhttps://github.com/tzyganu/UMC1.9/issues/112.
Hi Daran,
Thank you for the feedback.
My problem was , i have created an entity wtth a field "htmlcontent" as teatarea with wysiwsy option. The adminhtmlview was generated successfuly. but not "the magento way". So only a button "wysiwyg" was generated to open up a dialog to edit the content. Instead of editing the fiwld directly, wich causes Problems in Dialoghandling ob widgetcontent when inserting a widget. On the dialog the original buttons "insert variable" and "insert" ere missing. WYSIWYG makes no sense if you want to use variables or widgets in it.
Attached you find a Tab wich includes the editor the good old magento way. This renders the tetarea with all additional functions. Like Inserting widgets and variables.
With Variables and Widgetbuttons
At first i Implement the Widget_Tab_Interface and add all missing methods Then i have added the Wysiwyg Config After that I set the correct core renderer on the contentfield
<?php /**
@author Ultimate Module Creator */ class Ibrams_CmsExtended_Block_Adminhtml_Cmspage_Edit_Tab_Content extends Mage_Adminhtml_Block_Widget_Form implements Mage_Adminhtml_Block_Widget_Tab_Interface {
/**
protected function _prepareForm() {
$form = new Varien_Data_Form();
$form->setHtmlIdPrefix('cmspage_');
$form->setFieldNameSuffix('cmspage');
$this->setForm($form);
$fieldset = $form->addFieldset(
'cmspage_content',
array('legend' =>
Mage::helper('ibrams_cmsextended')->__('Content'),'class'=>'fieldset-wide') );
/*
* Checking if user have permissions to save information
*/
if ($this->_isAllowedAction('save')) {
$isElementDisabled = false;
} else {
$isElementDisabled = true;
}
$wysiwygConfig = Mage::getSingleton('cms/wysiwyg_config')->getConfig(
array('tab_id' => $this->getTabId())
);
$contentField = $fieldset->addField('htmlcontent', 'editor', array(
'name' => 'htmlcontent',
'style' => 'height:36em;',
'required' => true,
'disabled' => $isElementDisabled,
'config' => $wysiwygConfig
));
// Setting custom renderer for content field to remove label column
$renderer =
$this->getLayout()->createBlock('adminhtml/widget_form_renderer_fieldset_element') ->setTemplate('cms/page/edit/form/renderer/content.phtml'); $contentField->setRenderer($renderer);
$form->addValues($this->getCmspage()->getData());
$this->setForm($form);
Mage::dispatchEvent('adminhtml_cms_page_edit_tab_content_prepare_form',
array('form' => $form));
return parent::_prepareForm();
}
/**
/**
/**
/**
/**
/**
original implementation from UMC
<?php /**
@author Ultimate Module Creator _/ class Ibrams_CmsExtended_Block_Adminhtml_Cmspage_Edit_Tab_Form extends Mage_Adminhtml_Block_WidgetForm { /*
@author Ultimate Module Creator */ protected function _prepareForm() { $form = new Varien_DataForm(); $form->setHtmlIdPrefix('cmspage'); $form->setFieldNameSuffix('cmspage'); $this->setForm($form); $fieldset = $form->addFieldset( 'cmspage_form', array('legend' => Mage::helper('ibrams_cmsextended')->('Cmspage')) ); $fieldset->addType( 'editor', Mage::getConfig()->getBlockClassName('ibrams_cmsextended/adminhtml_helper_wysiwyg') ); $fieldset->addField( 'htmlcontent', 'editor', array( 'label' => Mage::helper('ibrams_cmsextended')->('htmlcontent'), 'name' => 'htmlcontent', 'required' => true, 'class' => 'required-entry',
) ); $form->addValues($this->getCmspage()->getData()); return parent::_prepareForm(); }
/**
2015-12-30 17:46 GMT+01:00 Darren Felton notifications@github.com:
Peter,
It should work just as any other WYSIWYG. Are you having trouble utilizing Magento's editor to insert a widget's code into the contents of the entity's attribute, or is the trouble with rendering the widget on output to screen?
Sent from my Sprint Samsung Galaxy S® 6.
-------- Original message -------- From: pboethig notifications@github.com Date: 12/30/2015 6:26 AM (GMT-06:00) To: "tzyganu/UMC1.9" UMC1.9@noreply.github.com Subject: [UMC1.9] How can i use insert widget function on wysiwyg mode of a textarea? (#112)
Hi,
If enable wysiwyg i cant insert a widget How can I enable that?
Kind regards
peter
Reply to this email directly or view it on GitHub< https://github.com/tzyganu/UMC1.9/issues/112>.
— Reply to this email directly or view it on GitHub https://github.com/tzyganu/UMC1.9/issues/112#issuecomment-168032221.
@pboethig Could you please try again to include your attachement(s)? They did not get added into the thread here on GitHub. I'd suggest navigating to this issue directly and posting your reply here.
So am I correct in understanding, that these buttons are missing for you?
yes correct.
I helped me out with using the core methods instead of generated blocks. teher some small differences.
2016-01-06 15:19 GMT+01:00 Darren Felton notifications@github.com:
@pboethig https://github.com/pboethig Could you please try again to include your attachement(s)? They did not get added into the thread here on GitHub. I'd suggest navigating to this issue directly and posting your reply here.
So am I correct in understanding, that these buttons are missing for you? [image: pic] https://cloud.githubusercontent.com/assets/2659558/12144566/37c694ba-b44e-11e5-9c5f-7b72fddba1b8.png
— Reply to this email directly or view it on GitHub https://github.com/tzyganu/UMC1.9/issues/112#issuecomment-169333803.
@pboethig This should be working out of the box. Do you mind attaching this file so I can check out the extension's configuration?
var/modulecreator/package/[Namespace]_[Module].xml.
@tzyganu do you mind closing this due to inactivity please?
Hi Darran,
This is my usecase. I have genereated an entity with some fields. Some of them are from the type "textarea" and I have chosen the option "WYSIWYG" Editor during configuration of the new module in UMC Modul Creator.
This worked like a charm and was very handy and easy. It generates an editform with all the fields. Even the WYSIWYG Editor appears and is functional. Only the small icon to insert a widget is missing.
I have compared the generated code with the corecodes and found out, that UMC generates the WYSIWYG Editor in another way than Mage Core does.
Kind Regards
Peter
2016-02-03 17:14 GMT+01:00 Darren Felton notifications@github.com:
@tzyganu https://github.com/tzyganu do you mind closing this due to inactivity please?
— Reply to this email directly or view it on GitHub https://github.com/tzyganu/UMC1.9/issues/112#issuecomment-179318544.
Hi,
If enable wysiwyg i cant insert a widget. How can I enable that?
Kind regards
peter