Add custom processing API for TCEMAIN.preview
To preview records, TCEmain.preview can be configured for any record type. Currently, one pid can be configured which points to a page holding a plugin which will display the record in frontend. That works fine.
However, sometimes you need different pids or other parameters which depend on the record itself or even related records. Currently, this cannot be achieved because TCEMAIN.preview lacks the possibility to build the link dynamically.
A typical scenario is preview of a news record whose detail pid depends on the (first) associated news category which holds the pid of the corresponding detail page.
To solve scenarios like this, my proposal is to add a property in TCEMAIN.preview which can point to a custom processing function. This function should get all nescessary information to access the data of the specific record to be previewed. It then returns the link to the frontend or (if you like that better) only a configuration which is then passed to the uri builder or typolink for postprocessing.