sometimes it’s useful to append a custom field to each content element in typo3, in my case it was the tt_content date – see the attached screenshot
I decided to attach the date to every tt_content-Element with a certain Layout – the second in the list.
It’s pretty simple:
temp.mainTemplate = TEMPLATE
temp.mainTemplate {
  template =< plugin.tx_automaketemplate_pi1
  ......
  workOnSubpart = DOCUMENT_BODY
  subparts.main_content < styles.content.get     
  subparts.main_content.select.where = colPos = 1
  subparts.main_content.renderObj.text{
    
    1000=TEXT
    1000.value= begin some wrapping code ...
    1010=TEXT
    1010.field = date
    1010.strftime = %A, %e. %B %Y   
    
    1020=TEXT
    1020.value= end some wrapping code ...
  }
 .....
}
....
page = PAGE
page.typeNum = 0
...
page.10 < temp.mainTemplate
....
