Bug #26394

Form Viewhelper does not work with html5 custom data attributes

Added by martin no-lastname-given almost 7 years ago. Updated over 6 years ago.

Status:
Rejected
Priority:
Must have
Assignee:
-
Category:
ViewHelpers
Target version:
-
Start date:
2011-04-28
Due date:
% Done:

0%

Has patch:
No
Affected Flow version:

Description

<f:form.textbox property="name" data-anything="some info" />

Will produce no output at all.

It would be great if fluid's tag-processing was more liberal and transparent in general. Maybe switch to DOM instead of the custom implementation?


Related issues

Duplicated by TYPO3.Fluid - Feature #29065: HTML5 Custom Data Attributes Closed 2011-08-17

History

#1 Updated by Sebastian Kurfuerst almost 7 years ago

  • Status changed from New to Rejected

Hey,

I guess you are using v4 and do not have your exception handler correctly configured? (in the install tool).

data-anything is not a supported argument by the Form-ViewHelper -- that's why an exception is thrown. If you are in production context, this exception leads to rendering only a white page.

Fix: <f:form.textbox additionalAttributes="{data-anything: 'some info'}" /> should work. If not, please file another bug.

Best regards,
Sebastian

#2 Updated by martin no-lastname-given almost 7 years ago

Sorry, must have missed that in the docs :)

#3 Updated by Bastian Waidelich over 6 years ago

  • Has patch set to No

martin wrote:

Sorry, must have missed that in the docs :)

Can you confirm, that the syntax from above works? (because we're not yet sure whether dashes are currently supported in the array syntax.

By the way: We're planning to extend the syntax so that you can specify array items directly like:

<f:form.textbox additionalAttributes.data-anything="some info" />

But that's not yet implemented.

#4 Updated by Thomas Allmer over 6 years ago

I can confirm that the following syntax works

<f:image src="{image}" alt="" maxWidth="140" maxHeight="280" additionalAttributes="{data-behavior: 'ImageFullDownload', data-imagefulldownload-fulldownload: '{a:uri.imageDownload(src: \'{image}\', maxWidth: 1920, maxHeight: 1200)}'}" />

it may get a little tricky with the ' but it works :)

the additionalAttributes dot syntax sure looks nice - looking forward to it :)

#5 Updated by Bastian Waidelich over 6 years ago

Thomas Allmer wrote:

I can confirm that the following syntax works

Thanks for the update!

Also available in: Atom PDF