TYPO3 Flow Base DistributionPackagesApplications

Suggestion #9179

Tx_Fluid_ViewHelpers_Form_RteViewHelper

Added by Frank Frewer almost 5 years ago. Updated about 2 years ago.

Status:New Start date:2010-08-06
Priority:Should have Due date:
Assigned To:- % Done:

0%

Category:-
Target version:-
Has patch:No Tags:

Description

With the attached RteViewHelper.php (Tx_Fluid_ViewHelpers_Form_RteViewHelper) it is possible to render a form field with the rtehtmlarea.

Due to the fact that rtehtmlarea needs to make some modifications to the form tag (attribute "onsubmit") and adds some js before and beyond the form, it is necessary to modify the FormViewhelper.php (see attached patch_FormViewHelper.diff based on FormViewHelper.php in https://svn.typo3.org/TYPO3v4/CoreProjects/MVC/fluid/trunk/ Revision 2522).
With this modifications the FormViewHelper gets the needed JS for all Rte form fields from the viewHelperVariableContainer which is filled in by the RteViewHelper and adds this to the returned content.

I'm working with extbase/fluid just since two weeks. So I hope my suggestion matches your coding guidelines. If not, please tell me, what could be better.

I didn't attach now files for v5. If you are interested i can do that later.

Note:
In conjunction with extensions based an extbase / fluid the RTE produces tags with ID's which are not valid:
<div id="pleasewaittx_meyxt_pi1[myobject][myfield] ...
<div id="editorWraptx_meyxt_pi1[myobject][myfield] ...
<textarea id="RTEareatx_meyxt_pi1[myobject][myfield] ...

The W3C Markup Validator says:
character "[" is not allowed in the value of attribute "id"

This happens in backend and frontend.

I reported this already to the bugtracker: http://bugs.typo3.org/view.php?id=15326

RteViewHelper.php Magnifier (7.5 kB) Frank Frewer, 2010-08-06 11:29

patch_FormViewHelper.diff Magnifier (1.4 kB) Frank Frewer, 2010-08-06 11:29

RteViewHelper.php Magnifier - New version (5.9 kB) Frank Frewer, 2010-08-13 14:59

RteConfiguration.php Magnifier (8.9 kB) Frank Frewer, 2010-08-13 14:59

ScriptViewHelper.php Magnifier (7.2 kB) Frank Frewer, 2010-08-13 14:59

History

#1 Updated by Bastian Waidelich almost 5 years ago

  • Status changed from New to Accepted
  • Assigned To set to Bastian Waidelich

#2 Updated by Frank Frewer almost 5 years ago

Hi Bastian,

according to the feedback you gave me in the newslist (http://lists.typo3.org/pipermail/typo3-project-typo3v4mvc/2010-August/006220.html et al.) I modified the coding.

The result is, that I created a new Script VH which has to wrap the Form VH to prepend/append the required JavaScripts to the form. With the Script VH it is not anymore necessary to modify Form VH.
And, of course, this VH could be used by other VH too.

Additionally I wrote a intermediate class Tx_Fluid_Classes_Core_ViewHelper_RteConfiguration.
At the moment this class will probably not work with rte in backend modules because the class tx_rtehtmlarea_pi2 is, if I'm not wrong, especially for the frontend. But if you agree to the general concept of my class, it might be possible to extend the functionality. The onsubmit JavaScript I put as an event handler to the JavaScript beyond the form.

regards,

Frank

#3 Updated by Jonas Götze almost 5 years ago

Hi,

It seems that there has been a change in current Fluid trunk which leads to an error with this wonderful view Helper.
The key of the formname in the viewHelperVariableContainer has to be 'formObjectName' instead of 'formName' (see RteViewHelper.php on line 95).

Regards,
Jonas

#4 Updated by Bastian Waidelich about 3 years ago

  • Status changed from Accepted to New
  • Assigned To deleted (Bastian Waidelich)
  • Has patch set to No

Also available in: Atom PDF