kasparov_8
(Enrico Faraoni)
November 7, 2023, 4:47pm
1
I wanted to capture the values of two parameters that come to us from outside to populate an iframe placed on a page
parameter1 =
parameter2 =
if I knew the values and set them directly in the typo3 setup area by writing for example
tt_content.list.20.ffiframe_pi1.src = https://www.example.it/exampledir/response.aspx ?
tt_content.list.20.ffiframe_pi1.src.dataWrap|userid={TSFE:fe_user|user|ses_userid}&sessionid={TSFE:fe_user|user|ses_id}¶meter1=1013&kparameter2=BE096614-7FB9-42E0-9E96-05B7973A10B8
I would get a result in the sense that IFRAME populates and I see something important on the page
but what to do when I don’t know the values of parameter1 and parameter2?
I tried something like this
tt_content.list.20.ffiframe_pi1.src = https://www.example.it/exampledir/response.aspx ?
tt_content.list.20.ffiframe_pi1.src.dataWrap = |userid={TSFE:fe_user|user|ses_userid}&sessionid={TSFE:fe_user|user|ses_id}¶meter1={}¶meter2={}
or
tt_content.list.20.ffiframe_pi1.src = https://www.example.it/exampledir/response.aspx ?
tt_content.list.20.ffiframe_pi1.src.dataWrap = |userid={TSFE:fe_user|user|ses_userid}&sessionid={TSFE:fe_user|user|ses_id}¶meter1={TSFE:idr}¶meter2={TSFE:k}
but I’m not getting any concrete results!
Forgive any syntactical blunders but I don’t know the syntax of Typo3 and I have no idea how it can populate my IFRAME, do you have any ideas to solve the problem? Thanks in advance for any answers
piphi
(Bernd Wilke)
November 9, 2023, 11:05am
2
there are multiple options you can build that URL.
use a COA:
here you are very flexible with each part of the resulting string and can see or test each individual part of it
tt_content.list.20.ffiframe_pi1.src.cObject = COA
tt_content.list.20.ffiframe_pi1.src.cObject {
10 = TEXT
10.value = https://www.example.it/exampledir/response.aspx?
20 = TEXT
20.data = TSFE:fe_user|user|ses_userid
20.wrap = userid=|
30 = TEXT
30.data = TSFE:fe_user|user|ses_id
30.wrap = &sessionid=|
40 = TEXT
40.data = GP:idr
40.wrap = ¶meter1=|
50 = TEXT
50.data = GP:k
50.wrap = ¶meter2=|
}
you used the other option: a dataWrap
.
tt_content.list.20.ffiframe_pi1.src = https://www.example.it/exampledir/response.aspx?
tt_content.list.20.ffiframe_pi1.src.dataWrap = |userid={TSFE:fe_user|user|ses_userid}&sessionid={TSFE:fe_user|user|ses_id}¶meter1={GP:idr}¶meter2={GP:k}
But you need to insert the correct data values.
For formular input you get the values by GET or POST which are available in TypoScript with the key GP
(Data / getText — TypoScript Reference 12.4 documentation )
If your data comes from somewhere else you need a construct to get the values. If you get these parameters from a database or any other service the option with dataWrap
could be complicated as you might need to prepare the data in a register (LOAD_REGISTER — TypoScript Reference 12.4 documentation ). A COA might enable you more complicated single data parts which gets wrapped with a parameter name.