In Drupal 7, with Panels, you could configure Views arguments to come from Pane context. For example, you could say that a Views argument gets it's value from a field on the Node context:

Drupal 8, it's possible to configure Views arguments to come from Block context, but only contexts that take entities, and the entity id is always passed into the argument - you can't configure the value to come from a field on the entity, for example.

I propose adding a similar configuration to Panopoly 2.x, which allows you to configure the argument value to come from any context type (including plain strings), and allow using tokens to extract sub-values from entities:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dsnopek created an issue. See original summary.

dsnopek’s picture

Status: Active » Needs review
FileSize
13.74 KB

Patch to implement is attached!

It works in my testing. The main thing I don't like about it is having to duplicate so much code from ViewsBlock::build() but I don't think there's any way around that.

dsnopek’s picture

Status: Needs review » Fixed

Early reports indicate that this is working! I'm going to be bold and merge :-)

  • dsnopek committed 76d53221 on 8.x-2.x
    Issue #3353820 by dsnopek: Allow configuring Views argument values from...

Status: Fixed » Closed (fixed)

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