blog.Resource

Archive:

News-Feeds:


RSS 2.0
RSS 0.91
RDF
ATOM 0.3
October 22, 2008

Personalizing a Response Page of a TYPO3 Mail Form

Category: Ron Hall

Today, I had a client who wanted to personalize a page being used as a response to a form created by a standard TYPO3 content element. The response page is the page specified in the "Jump to Page" field in the mail form content element.

I had never done this before, but it turned out to be very easy.

The following TypoScript generated on your response page will do the trick.

10 = TEXT
10.value = Howdy, {GPvar:firstname}
10.insertData = 1

PLEASE NOTE : Use this superior code instead of above (see comments).

10 = COA_INT
10.10 = TEXT
10.10.value = Howdy,
10.10.dataWrap= | {GPvar:name}
10.10.htmlSpecialChars = 1

This will replace {GPvar:firstname} with the name the person entered in the mail form field called "firstname."

Also, if you install the extension TypoScript Code (extension key: typoscript_code) you can place this TypoScript directly on the page like any other content element. This is a very handy extension for this kind of situation.

Be aware that you will need to set the response page to "no cache" in the page properties. PLEASE NOTE: You do not need to set the page to no cache if you use the the second set of code instead of the first. (see comments).


comments

comment #1
Gravatar: Ingo Ingo October 22, 2008 02:40
This is a great tip! Thanks for sharing Ron!

comment #2
Gravatar: Robert Robert October 22, 2008 03:52
This might come handy at times. Thanks!

comment #3
Gravatar: Dmitry Dulepov Dmitry Dulepov October 22, 2008 08:39
no_cache is always a bad advice. Correct solution is:

10 = COA_INT
10.10 = TEXT
10.10.value = Howdy, {GPvar:firstname}
10.10.insertData = 1

There is no need for no_cache. Page is still cached but name is always ok because this object (the only object on the page!) is not cached.

Never use no_cache in TYPO3 if you want good performance.

comment #4
Gravatar: Marc Bastian Marc Bastian October 22, 2008 21:28
You should also add an "htmlSpecialChars = 1" to don't get in trouble with XSS.

comment #5
Gravatar: Ron Hall Ron Hall October 22, 2008 22:12
Thanks, Dimitry and Marc for the extra code. Those are both good suggestions. I wrote the entry so fast after discovering the trick that I hadn't worked through all issues.

comment #6
Gravatar: Ron Hall Ron Hall October 22, 2008 22:38
After working with it. This is the code that is needed to pull off the no cache on just the element and run through htmlSpecialChars

10 = COA_INT
10.10 = TEXT
10.10.value = Howdy,
10.10.dataWrap= | {GPvar:firstname}
10.10.htmlSpecialChars = 1

I will correct in post

comment #7
Gravatar: maddesigns maddesigns October 23, 2008 13:59
Thats great, thanks for the snippet.

comment #8
Gravatar: Charles Coleman Charles Coleman October 27, 2008 17:33
Thank you Ron. I wish more people would post stuff like this!

Sorry, comments are closed for this post.