简体   繁体   中英

Powermail/Typo3: prefill form field using image title

Using Typo3 8.7.4/Powermail 3.21.2

I'm pretty new to Typo3, so I have no clue if this is even the right way to do it, but heres my problem:

On the site there are several subpages with images/descriptions of articles on them. Every article has an UID stored in the image title (dont ask me why). When an image is clicked it links to another page with a powermail mailform.

In this form there's a textfield for the UID which should automatically fill with the UID in the image title so the user doesn't have to do it manually. That essentially it.

I know you can prefill a field with a value or placeholder, but should I even use a textfield or use TS instead? And what should I add to the image link for the UID to get posted to the form?

Or am I doing this completely wrong? All help appreciated, thank you and have a nice day!

There are several ways of prefilling form fields in powermail (look at the manual https://docs.typo3.org/typo3cms/extensions/powermail/ForAdministrators/BestPractice/PrefillField/Index.html ) and I would say that there is no wrong way. Just choose the right one for your needs.

You can Do like This.

plugin.tx_powermail.settings.setup.prefill {
    position = CONTENT // Here Position is your powermail form fields
    position {
       table = Your tables
       select {
            selectFields = title
            andWhere.data = GP:title  // Pass your url parameters
            andWhere.wrap = uid=|
            pidInList = 108 // Added Your Pid 
       }
       renderObj = TEXT
       renderObj.field = title
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM