1

I'm not very familiar with data processing and I'm stuck. I created a new field customer_id in the table tt_content, in which the uid of a tt_address record is stored.

Now I need to read that customer_id from tt_content and fetch the associated record from tt_address to display name and company of it in the fluid template.

    tt_content.customerdata =< lib.contentElement
    tt_content.customerdata {
        templateName = Kundeninfo
        dataProcessing {
            10 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
            10 {
                table = tt_content
                uidInList.field = customer_uid
                fieldName = customer_uid
                ??? 
                as = customer
    
            }
        }
    }

Update: It woks with

10 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
10 {
  if.isTrue.field = customer_uid
  table = tt_content
  selectFields = tt_address.*
  join = tt_address ON tt_address.uid IN(tt_content.customer_uid)
  where = tt_content.uid = 568
  as = customer
  }

One last problem In tt_content only one customer_uid (related to the uid of tt_address) is saved for some elements. The above code selects all addresses whose uids are stored in tt_conent. Now i need to get only the matching address to the elements form tt_content. I tested it with one uid of a content element (568) in the code above, that works.

Now i don't know how to code the where condition to read the associated record from tt_address to every content element that has a customer_uid

Thanks

Steffi
  • 27
  • 4
  • Does this answer your question? [TCA - show tt\_address company as a select field in custom content element](https://stackoverflow.com/questions/74349505/tca-show-tt-address-company-as-a-select-field-in-custom-content-element) – Julian Hofmann Nov 15 '22 at 10:19
  • 1. try to identify all variables: `{_all}` --- 2. as your customer is a relation from another record it probably is a field from that record variable instead of a variable on it's own. – Bernd Wilke πφ Nov 15 '22 at 14:55
  • @Berdn Wilke `{_all}` shows settings => array (2items) data => array (72items) current => NULL table => array (5items) – Steffi Nov 16 '22 at 10:36

0 Answers0