Now that you can't do a drupal_set_title() in Views, it would be nice to use the label or label_callback of an entity for rendering the argument title via the title_query method or title method.

Benefit:

  • Entity properties of type 'entity' could use that entity's label or label callback as the title.

Tradeoff:

  • Although views_handler_argument_node_nid does this, it does have a performance impact.

Yay or nay?

Comments

fago’s picture

Sounds good. Why does it have a performance impatct? I'd assume the entity is already loaded and getting the label should be cheap?

mradcliffe’s picture

I was just looking at how views_handler_argument_node_nid handles things. It actually does an extra database query on the node table.

Yeah, if we can access the entity in the view object, then it should be cheap.