typo3typoscripttt-news

Typo3 mbl_newsevent post date to URL


I got an event glossary at my site and the user needs to register for that events with powermail. I post the event title to the URL and then the title gets inserted into a input field at my powermail form. But now I need the date of the event, too.

This is my code so far:

        plugin.tt_news.mbl_newsevent{
  registrationLink_typolink {
    additionalParams.cObject = COA
  additionalParams.cObject {
    10 = TEXT
    10 {
     value = &tx_powermail_pi1[veranstaltung]={field:title}
     insertData = 1
    }
    20 = TEXT
    20 {
     value = {field:tx_mblnewsevent_from}
     insertData = 1
     stdWrap.date = d.m.Y
     stdWrap.outerWrap = &tx_powermail_pi1[datum]=|

    }
}

}

output is (URL): http://preview.eloum.de/anmeldung-infotag/?tx_powermail_pi1%5Bveranstaltung%5D=Infotag%20eBusiness-Lotse%20Oberschwaben-Ulm%2028.03.2014&tx_powermail_pi1%5Bdatum%5D=01.01.1970

why 01.01.1970? the timestamp is correct without that stdWrap.date = d.m.Y

EDIT: got it! My solutioN:

plugin.tt_news.mbl_newsevent{
  registrationLink_typolink {
    additionalParams.cObject = COA
  additionalParams.cObject {
    10 = TEXT
    10 {
     value = &tx_powermail_pi1[veranstaltung]={field:title}
     insertData = 1
    }



    20 = TEXT
    20 {

     field = tx_mblnewsevent_from
     insertData = 1
     date = d.m.Y
     wrap = &tx_powermail_pi1[datum]=|

    }
}

  }}

Solution

  • Can you try

    registrationLink_typolink {
      ...
      additionalParams= &tx_powermail_pi1[veranstaltung]={field:title}&tx_powermail_pi1[datum]={field:datetime}
      additionalParams.insertData = 1
    }
    

    ... here's another try. I haven't tested it and I'll have to leave it there. So maybe you have to make some modifications. The general idea is that, as you can't say $date = makereadabledate($timestamp); and then use that in your template (as TS isn't a real programming language), you build the value you want to pass to additionalParams as a so called "cObject". In there, you can parse and wrap it. In the end, you would pass your string for further use to additionalParams. Hope you can make it work!

    registrationLink_typolink {
      ...
      additionalParams.cObject = COA
      additionalParams.cObject {
        10 = TEXT
        10 {
         value = &tx_powermail_pi1[veranstaltung]={field:title}
         insertData = 1
        }
    
        20 = TEXT
        20 {
         value = {field.datetime} // or use "data"
         insertData = 1
         stdWrap.date = d.m.Y
         stdWrap.outerWrap = &tx_powermail_pi1[datum]=|
         // outerWrap: maybe not even necessary, the idea is not to interfere with the created string
         // cf. http://blog.bartlweb.net/2011/02/die-reihenfolge-der-wichtigsten-wraps-in-typo3/
        }
      }
    }