Task #30851
closedAdd CSS Class to special input types in FORM
100%
Description
With the new FORM Object all elements are nested in an ordered list.
In my case I added a hidden field. The structure is
ol
- li
- - input
(screenshot)
All li elements have a class like csc-form-2, csc-form-2
It may be not optimal to format the output properly in the frontend with li>input[:hidden] (or similar), so my suggestion is to add a class like "csc-form-2 input-hidden" to the li-element or "csc-form-2 input-textarea" depending on the following input fieldtype.
Files
Updated by Ingo Pfennigstorf about 12 years ago
Actually I wanted to put it into gerrit - but it failed updating some refs. In the mean time here is my solution for sysext/form/Classes/View/Form/Element/Abstract.php - starting line 368
/** * Return the id for the element wraps, * like <li class="csc-form-2 tx_form-hidden"> ... </li> * * @return string */ public function getElementWrapId() { $elementId = (integer) $this->model->getElementId(); $fieldType = $this->model->getAttributes(); $wrapId = 'csc-form-' . $elementId; if (gettype($fieldType['type']) === 'object') { $wrapId .= ' tx_form-' . $fieldType['type']->getValue(); } return $wrapId; }
Updated by Mr. Hudson about 12 years ago
Patch set 1 of change Ia14641d488f10e2a60f9ba0fafdc10f31d0eeb1d has been pushed to the review server.
It is available at http://review.typo3.org/5745
Updated by Mr. Hudson about 12 years ago
- Status changed from New to Under Review
Patch set 2 of change Ia14641d488f10e2a60f9ba0fafdc10f31d0eeb1d has been pushed to the review server.
It is available at http://review.typo3.org/5745
Updated by Mr. Hudson about 12 years ago
Patch set 3 of change Ia14641d488f10e2a60f9ba0fafdc10f31d0eeb1d has been pushed to the review server.
It is available at http://review.typo3.org/5745
Updated by Ingo Pfennigstorf about 12 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset fb6f05732046083fb7e969add563d2865bff7835.
Updated by Oliver Hader about 12 years ago
- TYPO3 Version changed from 4.6 to 4.7
Updated by Riccardo De Contardi about 6 years ago
- Status changed from Resolved to Closed