Project

General

Profile

Actions

Task #30851

closed

Add CSS Class to special input types in FORM

Added by Ingo Pfennigstorf over 12 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Should have
Category:
Frontend
Target version:
Start date:
2011-10-12
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
4.7
PHP Version:
5.3
Tags:
Complexity:
Sprint Focus:

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

Auswahl_003.jpeg (12.9 KB) Auswahl_003.jpeg Ingo Pfennigstorf, 2011-10-12 16:25
Actions #1

Updated by Ingo Pfennigstorf over 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;
    }
Actions #2

Updated by Mr. Hudson over 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

Actions #3

Updated by Mr. Hudson over 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

Actions #4

Updated by Mr. Hudson over 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

Actions #5

Updated by Steffen Ritter over 12 years ago

  • Target version set to 4.7.0-alpha1
Actions #6

Updated by Ingo Pfennigstorf over 12 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #7

Updated by Oliver Hader over 12 years ago

Reverted in favour of issue #31561

Actions #8

Updated by Oliver Hader over 12 years ago

  • TYPO3 Version changed from 4.6 to 4.7
Actions #9

Updated by Riccardo De Contardi over 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF