Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Currently row plugins have pre_render, why not post_render. Let's add one, maybe people can use it.
Comments
Comment #1
merlinofchaos CreditAttribution: merlinofchaos commentedI would wait until there's an actual use case; pre_render exists because there is a need to pre-fetch data before all rows are rendered. I don't have any use cases for a similar post_render.
Comment #2
dawehnerHere is a case for a post_render not on row plugin but on field handlers.
Views_field_view (vfv) uses tokens to bring arguments from the parent view to the "child" view.
Currently vfv only supports raw-value tokens, because it uses pre_render() when producing an aggregated view to handle all rows on a single view.
The problem is that raw-value tokens doesn't really help on things like fieldapi because you need actual rendered fields, but hey we used pre_render, you are lost.
My idea to solve this is to introduce a post_render method which str_replaces some output tokens like this "views-field-view-output-token-row-1". At this time the fields are rendered so vfv can use the information. Things like empty result don't work with that, but maybe this could be improved later.
Comment #3
MustangGB CreditAttribution: MustangGB commented