3

Using the Flag module I have created a bookmark flag for User and Node entities. Working so far so good, but I cannot create a view that displays both Node and User entities in one view.

How do I do this without having to dump views and hand-create the page in PHP?

5
  • Just an idea into the blue: What happens if you flag both, nodes and users? Can you create a view from that?
    – leymannx
    Aug 27, 2015 at 16:25
  • When you create view, and are asked to select users or nodes, don't you have a "flag" option there? If you do, create view of flags and add users and nodes as references.
    – Mołot
    Aug 27, 2015 at 16:38
  • 1
    No, I cannot create a view of flags @molot, that was my first thought too...
    – Skynet
    Aug 27, 2015 at 16:55
  • @leymannx I cannot create a relationship to flagged_users from the Nodes view and vice versa :/
    – Skynet
    Aug 27, 2015 at 16:56
  • @Skynet Strange, I was so sure you can do it... Well, at least you thought about that before asking.
    – Mołot
    Aug 27, 2015 at 16:58

1 Answer 1

0

One option is to add a user view as a footer to the node view. The footer can be configured to inherit the same contextual filters as the main view.

You can't get joint paging or joint filtering using this approach but it works in some scenarios.

I've also hacked into the views hooks before and manually created a db join but that is a nightmare to maintain so I wouldn't recommend it.

1
  • Yeah the "stick it in the footer" is how I'm doing, downside is not just no joint paging and especially no joint sorting by flag date.
    – Skynet
    Aug 28, 2015 at 9:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.