0

I'm using drupal 7 with entityform, views, rules

All is in the title, i need to list some profils fields (name, mail etc..) of users who flagged an entityform.

Exemple : User X send an entityform. User Y and Z are interested and click on a button(flag) "TAKE". When user x come in his list of entityforms submitted he can click on one of them and then he got all informations of users who clicked on "TAKE" flag.

So for each entity form the result can be different.

**Edit : More informations : For now i have a view who list all the entityforms of my user X, on each of these items i have a link called "access folder" who show the entityform details page.

What i try to do in the entityform details page is to add a block who list all Users who clicked on the "TAKE" Button.**

** Edit 2 : What i did for now, - i created a view block of type "entityform type" - I gave a name for the block and added it in my left sidebar - in the option of the block i specified "entityform/*" in "only in this pages list"

  • comming back in view i added a relationship with "Entityform Type: Entityform Submission" who is the entityform i'm using, and "(Entityform Submission) Flags: TAKE (by any user)"
  • in contextual filters i added : "(Entityform Submission) Entityform Submission: Entityform submission ID" and specified "Provide default value" : "Content ID from URL"

I don't rly know whats wrong if someone can tell me **

Edit 3 : i think, in contextual filter, the "content ID from URL" does not work with entity forms. Am i right ?

Thanks in advance guys !

  • Do you also have a question? Something that ends with a "?" ... – Pierre.Vriens Apr 24 '18 at 17:47
  • i just don't know how to do it properly, i succefully got a general result (who click on all my entityforms buttons) but i want it to be a result by entityform – Quentin Apr 25 '18 at 7:41
  • @Quentin are you talking about two problems? One showing information about users who flagged a form, and the other how to filter the list of entityforms to the one you're currently visiting. Is this true? The Contextual filter should work with entityforms, or is it a multi-step form? – prkos Apr 25 '18 at 21:34
  • @prkos you already answer to me xD but yes it was that without multisteps form – Quentin Apr 26 '18 at 7:48
0

You're on a good track with creating the Entityform type of View. When you first created this View you chose which Entityform this is about, you can see it (change it) under Filter criteria. This view is now listing all submissions for that form.

You have also setup a Flag "Take" that users can use on Submissions of that form. And you want to show a list of all users who flagged a submission, on the submissions page.

When you create a fresh Entityform view you'll have only the field "Entityform: Entityform ID" and the Filter "Entityform: Entityform Type".

If you create a Page in that view you can list all the flags for all submissions for that Entityform. You can maybe use this page as a test, to see the user info correctly listed on submission, and delete it later.

You'll have to create a Block display to be added to submissions pages, this is what you're after.

Here is what you have to do to your Entityform view to show info about users who flagged a submission:

  1. Add Relationship Flags: flag_take (or however your flag is called). Configure that Relationship to show Any user, and not Current user. This will list flags from all users who flagged it, not only the flags from the user currently looking at the page.

  2. Add a new Relationship Flags: User that uses the previous Relationship flag. This introduces info about users who flagged the submission with "take" to be available in this Views.

  3. To actually display the user info Add a new Field User: Name and set it to use the Relationship Flag user. This will show the name of the user who flagged the submission. To show other user info add different user fields and make them use the Relationship Flag user (otherwise you'll show info for the user who submitted the form, and not the one who flagged the submission).

  4. Add a new Contextual filter Entityform: Entityform ID and configure it so that

    When the filter value is NOT available:
    Provide default value
    Type: Raw value from URL
    Path component: 2

    When the filter value IS available or a default is provided:
    Specify validation criteria
    ** - Basic validation - ** Hide view (or whatever makes sense to you)

    And set that Contextual filter to This block (override) because it doesn't make sense to have it on a page display, for example.

  5. Save the view and place the block in a region you want, you can specify the path where to show the block, like you mention in your question, this is good for performance. The Contextual filter that will make sure to only list results relevant to the particular entityform submission.

If you need to check the Block while working on it in Views enter an ID number of one submission that got flagged, to preview the result.

  • Oh man thank you a lot you resolved my issue !!! :) so my mistake was in the contextual filter with the Raw value from URL option and his path component 2 who i suppose check the id there : "www.site.com/entityform/**here**" and not "www.site.com/**here**" right ? – Quentin Apr 26 '18 at 7:44
  • @Quentin I'm glad to help :) Since Entityform is a bit different from a content type in d7 using Content ID from URL can't work, instead you have to use Raw value from URL. Yes, you got it right about the path components. In Entityform module the paths are generated with that pattern /entityform/[entityformID]. You can count the number of components starting from the $baseurl which is usually your domain name, components are separated with "/". And just to keep with the notion of completeness, I'm a woman :D (^-^) – prkos Apr 26 '18 at 18:51
  • Oups sry for that "Man" above xD. Again thank you a lot my head was about to explode :p have a good day ! – Quentin Apr 27 '18 at 7:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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