Bug #42500

Sysext form output not adjustable via ts in 4.7.5

Added by Bernhard Eckl almost 5 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2012-10-29
Due date:
% Done:

0%

TYPO3 Version:
4.7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

In T3 4.7.4 I used the following typoscript to adjust the output of the form sysext:

### Mailform ###
tt_content.mailform.10.20 =
tt_content.mailform.20.params.form = class="ym-form" 
#tt_content.mailform.20.stdWrap.dataWrap = <div class="ym-form">|</div>
tt_content.mailform.20.stdWrap.wrap = <fieldset class="ym-form"> | </fieldset>
tt_content.mailform.20.params.input = class="ym-fbox-text" 
#tt_content.mailform.20.params.password = class="mf-pass" 
tt_content.mailform.20.params.textarea = class="ym-fbox-text" 
#tt_content.mailform.20.params.check = class="mf-check" 
#tt_content.mailform.20.params.radio = class="mf-radio" 
tt_content.mailform.20.params.select = class="ym-fbox-select" 
tt_content.mailform.20.params.file = class="mf-file" 
tt_content.mailform.20.params.reset = class="ym-button" 
tt_content.mailform.20.params.submit = class="ym-button" 

#tt_content.mailform.20.layout = <div class="ym-fbox-text">###LABEL### ###FIELD###</div>
#tt_content.mailform.20.COMMENT.layout = <div class="csc-mailform-label1">###LABEL###</div>
tt_content.mailform.20.RADIO.layout = <div class="ym-fbox-check">###LABEL### <span class="csc-mailform-radio">###FIELD###</span></div>
#tt_content.mailform.20.LABEL.layout = <div class="csc-mailform-field2">###LABEL### <span class="csc-mailform-label">###FIELD###</span></div>
### Mailform End ###

But since 4.7.5, this does not work anymore. I also could not find any documentation about this.

form-confirmation.png View (28.7 KB) Bernhard Eckl, 2013-05-13 20:55


Related issues

Related to Core - Bug #31951: Own checkbox layout breaks HTML mail Resolved 2011-11-20

History

#1 Updated by Georg Ringer almost 5 years ago

  • Status changed from New to Needs Feedback

can you specify what exactly doesn't work anymore and how this can be reproduced?

#2 Updated by Bernhard Eckl almost 5 years ago

The whole typoscript above does not have any affect in 4.7.5 (maybe a few lines still work, I’m not 100% sure). E.g. this doesn’t have any affet in the frontend: tt_content.mailform.20.params.submit = class="ym-button"

#3 Updated by Fabien Udriot almost 5 years ago

Checkout manual in SYSEXT:form/Documentation/Manual/en/manual.sxw. Wouldn't it be more this kind of configuration of the FORM object to tamper?

[...]

Update: I am also facing the problem that the mailform configuration is not applied (running a 4.7.5 TYPO3 too). I haven't dug more than that.

#4 Updated by Tomas Havner over 4 years ago

Try:

tt_content.mailform.20 {
stdWrap.wrap >
layout {
form (
<form class="form-horizontal">
<containerWrap />
</form>
)
containerWrap (
<section>
<elements />
</section>
)
elementWrap (
<div>
<element />
</div>
)
mandatory (
<sup class="ym-required">
<mandatoryvalue />
</sup>
)
error (
<strong class="ym-message">
<errorvalue />
</strong>
)
textline (
<div class="control-group">
<label class="control-label"><label /></label>
<div class="controls"><input /></div>
</div>
)
textarea (
<div class="ym-fbox-text">
<label />
<textarea />
</div>
)
select (
<div class="ym-fbox-select">
<label />
<select>
<elements />
</select>
</div>
)
checkbox (
<div class="ym-fbox-check">
<input />
<label />
</div>
)
radio (
<div class="ym-fbox-check">
<input />
<label />
</div>
)
button (
<div class="ym-fbox-button">
<input />
</div>
)
reset (
<div class="ym-fbox-button">
<input />
</div>
)
submit (
<div class="ym-fbox-button">
<input />
</div>
)
}
}

/Tomas

#5 Updated by Bernhard Eckl over 4 years ago

Does not work. Any other ideas, is there somebody who knows how it works actually?
In my case I want to add the classes needed to apply css for the yaml css framework (without changing all the css).
I think this should also get integrated into the manual to know how to adjust the output (if it is already known).

Here is also described how it worked in the past: http://forge.typo3.org/issues/42500

#6 Updated by Bernhard Eckl over 4 years ago

I just tested the typoscript of Tomas Havner again in the new T3 6.1 and it works now (I also found the part in the manual now).

BUT: If confirmation is activated, the confirmation page is broken, the text in the form is not displayed and it is not possible to send the form.

Here is the html output of the confirmation page and enclosed also a screenshot (confirmation page should not use the typoscript for the layout):

<section>
  <div class="csc-form-2 csc-form-element csc-form-element-textline">
    <div class="ym-fbox-text">
      <label>Vorname</label>
      <div class="controls">
        <input/>
      </div>
    </div>
  </div>
  <div class="csc-form-3 csc-form-element csc-form-element-textline">
    <div class="ym-fbox-text">
      <label>Nachname</label>
      <div class="controls">
        <input/>
      </div>
    </div>
  </div>
  <div class="csc-form-4 csc-form-element csc-form-element-textline">
    <div class="ym-fbox-text">
      <label>Firma</label>
      <div class="controls">
        <input/>
      </div>
    </div>
  </div>
  <div class="csc-form-5 csc-form-element csc-form-element-textline">
    <div class="ym-fbox-text">
      <label>E-Mail</label>
      <div class="controls">
        <input/>
      </div>
    </div>
  </div>
  <div class="csc-form-6 csc-form-element csc-form-element-textline">
    <div class="ym-fbox-text">
      <label>Betreff</label>
      <div class="controls">
        <input/>
      </div>
    </div>
  </div>
  <div class="csc-form-7 csc-form-element csc-form-element-textarea">
    <div class="ym-fbox-text">
      <label>Nachricht</label>
      <textarea/>
    </div>
  </div>
</section>

            <form class="csc-form-confirmation" method="post" action="kontakt/">
                <fieldset>
                    <ol>
                        <li class="csc-form-confirmation-false">
                            <input type="submit" value="Zurück zum Formular" name="tx_form[confirmation-false]" />
                        </li>
                        <li class="csc-form-confirmation-true">
                            <input type="submit" value="Bestätigen" name="tx_form[confirmation-true]" />
                        </li>
                    </ol>
                </fieldset>
            </form>

#7 Updated by Alexander Opitz about 4 years ago

  • Status changed from Needs Feedback to New
  • Is Regression set to No

#8 Updated by Bernhard Eckl over 3 years ago

Again I had the same problem and solved it by hardcoding into the ext (quick and dirty). The thing is, that for confirmation and mail there should be other typoscript arrays.

Changes (T3 4.7, brackets are replaced by this board…):

Classes/View/Confirmation: line 137

return '&lt;form class="csc-form-confirmation ym-form" method="post" action="' . $action . '"&gt;'.$this->localCobj->cObjGetSingle($type, $value);
(The form tag should be at the beginning, otherwise some classes of CSS frameworks are not working)

Classes/View/Mail/Html/Element/Abstract.php: line 221-223

$layout = str_replace('&lt;input /&gt;', '&lt;/td&gt;&lt;td&gt;&lt;inputvalue /&gt;', $layout);
$layout = str_replace('&lt;textarea /&gt;', '&lt;/td&gt;&lt;td&gt;&lt;inputvalue /&gt;', $layout);
$layout = str_replace('&lt;div class="ym-fbox-text clearfix"&gt;', '&lt;td class="labeltd" style="width: 200px;" &gt;', $layout);
$layout = str_replace('&lt;/div&gt;', '&lt;/td&gt;', $layout);

And in case elementWrap:

$layout = str_replace('&lt;div&gt;', '&lt;tr&gt;', $layout);
$layout = str_replace('&lt;/div&gt;', '&lt;/tr&gt;', $layout);

And in containerWrap:

$layout = str_replace('&lt;section&gt;', '&lt;tr&gt;', $layout);
$layout = str_replace('&lt;/section&gt;', '&lt;/tr&gt;', $layout);

Classes/View/Confirmation/Element/Abstract.php: lines 225-226

$layout = str_replace('&lt;input /&gt;', '&lt;inputvalue /&gt;', $layout);
$layout = str_replace('&lt;textarea /&gt;', '&lt;inputvalue /&gt;', $layout);

This works with the following typoscript:

tt_content.mailform.20 {
#stdWrap.wrap >
layout {
form (
<form class="ym-form ym-columnar">
<containerWrap />
</form>
)
containerWrap (
<section>
<elements />
</section>
)
elementWrap (
<div>
<element />
</div>
)
mandatory (
<sup class="ym-required">
<mandatoryvalue />
</sup>
)
error (
<strong class="ym-message">
<errorvalue />
</strong>
)
textline (
<div class="ym-fbox-text clearfix">
<label />
<input />
</div>
)
textarea (
<div class="ym-fbox-text clearfix">
<label />
<textarea />
</div>
)
select (
<div class="ym-fbox-select">
<label />
<select>
<elements />
</select>
</div>
)
checkbox (
<div class="ym-fbox-check">
<input />
<label />
</div>
)
radio (
<div class="ym-fbox-check">
<label />
<input />
</div>
)
button (
<div class="ym-fbox-button">
<label />
<input />
</div>
)
reset (
<div class="ym-fbox-button">
<label />
<input />
</div>
)
submit (
<div class="ym-fbox-button">
<label />
<input />
</div>
)
}
}

So please add additional Typoscript layout options for confirmation and for mail (input can not be used for confirmation and mail, there it should be inputvalue, this is the main problem).

#9 Updated by Bernhard Eckl about 3 years ago

I just had a new project starting with TYPO3 6.2, I also switched to Bootstrap, and I also used extension bootstrap_package. So with this system there is still the same problem (problem can be easily reproduced, the current Demo is based on that version and bootstrap_package, you just have to change the form to get a mail (then you can see that the mail content is buggy) and activate confirmation page (then you can see the broken confirmation page). This is because bootstrap_package has some typoscript for styling the form, but the same problem occurs as I mentioned. Please can someone fix that?! I don’t want to be a lonely talker…

#10 Updated by Frans Saris almost 3 years ago

I think this one can be closed now #31951 is reloved.

#11 Updated by Frans Saris almost 3 years ago

  • Status changed from New to Needs Feedback

#12 Updated by Riccardo De Contardi over 2 years ago

  • Status changed from Needs Feedback to Closed

If you think that this is the wrong decision or experience this issue again, then please write to the mailing list typo3.teams.bugs with issue number and an explanation or open a new ticket and add a relation to this ticket number.

Also available in: Atom PDF