One common pitfall when working with TYPO3 extension powermail

I’ve had the problem myself, when I used powermail years ago for the first time. And I’ve seen it again and again with other developers since then: The extent use and automatic inclusion of jQuery and some other Javascript libraries is a constant cause for non-working powermail forms, after having it set up. And too often the developer is at first clueless, why it’s not working, as the problem’s resulting from a fact, he is not necessarily aware of: Javascript conflicts, which occur as soon as you add the powermail static TypoScript templates to your website.

The reason for that: powermail does a lot of form validation (and some other stuff) in the front end, which depends on jQuery. Therefore it includes a (more or less) current version of jQuery and some other plugins per default. If your website already uses jQuery, this leads to Javascript conflicts (as you typically can only use one jQuery lib at a time), causing the form validation and therefore the whole form to crash.

The solution, though, is pretty simple, as soon as you know about it. Just overwrite the powermail TypoScript in your own TypoScript setup and clear the jQuery inclusion:

If that still does not make your form work, check also the other Javascripts that are included by powermail. Maybe you have to remove some of them also.

Fortunately the powermail FAQ gives you a good overview of the potential Javascript issues in the meantime (that has not always been that way).

And furthermore be also aware of the different possibilities of Javascript inclusion in TypoScript (includeJS, includeJSlibs, includeJSFooterlibs, includeJSFooter –> you have to scroll down), as they define in which order the Javascripts get included on your page. Depending on your previous setup you possibly have to make some changes to that, too (e.g. you have to make sure, that your already used jQuery library is loaded before the jQuery plugins from powermail which you have left in place, otherwise it won’t work either).

And finally here a link to an article discussing the best way of how to include Javascript in TYPO3 extensions (unfortunately only in German): Die Krux mit dem jQuery.

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)
Loading...Loading...

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">