To do this we moved drupal_render() from each row function into ds_views_row_render_entity(), with a new alter hook providing some context (including the view object). This was useful to allow an entity presented through views in a table row to know something about it's position in the view display.

Comments

scottrigby’s picture

Status: Active » Needs review
StatusFileSize
new3.71 KB
tim.plunkett’s picture

Status: Needs review » Needs work

This is a good improvement.

+++ b/ds.api.phpundefined
@@ -553,6 +553,17 @@ function ds_views_row_adv_VIEWS_NAME(&$vars, $view_mode) {
+ * Modify the entity render array in the context of a view.
+ */
+function hook_ds_views_row_render_entity_alter(&$content, &$context) {

This needs @param docs with specifics for $context especially

scottrigby’s picture

Status: Needs work » Needs review
StatusFileSize
new4.16 KB

@tim added

tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me.

swentel’s picture

Status: Reviewed & tested by the community » Fixed

Looks fine, committed and pushed :)

Btw, love the technique of letting one colleague post the patch and another setting it RTBC ;) (we do that too, don't worry heh)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.