0
votes

I am working with the TYPO3 News system and the Formhandler Extension

I have some forms and they work completely fine on every page, but I can't insert it into a Newsdetail page.

Every form is saved into a temp Variable, like this:

temp.contactform < plugin.tx_formhandler_pi1

(And then follow all the settings like sender_email etc. which I didn't add here.)

So on every other page I insert the form under the menu "Template" like this and insert the plugin:

page.10.variables.form < temp.contactform

And in the Layout file I just call: <f:format.raw>{form}</f:format.raw>

The form appears and works just fine.

I tried to insert the TypoScript on the Detail page and also directly into plugin.tx_news and then write <f:format.raw>{form}</f:format.raw> in Detail.html but it just doesn't insert my form.

For me it looks like the News Plugin doesn't allow custom temps. Because if I try to insert anything other than the form, e. g. simple text, as a temp, it also doesn't get inserted into the Detail page.

Google also didn't help me any further. Can you tell me if it's even possible to connect formhandler and News into one page?

1

1 Answers

1
votes

You can't use the fluid variable form in your news templates, as your variable is defined in page context and the news context does not know about it.

Also all TypoScript temp.* objects are deleted before rendering is started, so you can't use any temp.* in a f:cObject viewhelper. (use a lib.* object instead, maybe even copy it: lib.contactform < temp.contactform)

You should insert your form in the page like on any other page as the detail page just is like any other page, except that the content of the news plugin only shows just one record.

Your problem might be:
for a detail page further URL parameter decide the shown record. if your form does not respect these parameter and just call the page by uid the news plugin don't know which record to show and will give an error message instead.


As ext:formhandler is obsolete since November 2017 you should migrate your forms to a supported extension. At least when you update your TYPO3 as you probably use 7LTS which also left public support recently.