I've been trying to search around for this everywhere but can find anything on it. I assumed it would come standard with Views integration so I could be wrong, but is it possible to place the "Flag this" link as a field in a view? My problem is users have go to the node to "flag" it, but I want them to be able to do it from the view.

CommentFileSizeAuthor
#8 Screenshot-2.png17.8 KBsiva.thanush

Comments

mooffie’s picture

is it possible to place the "Flag this" link as a field in a view?

Yes.

First you need to pull in the "Flag: Node flag" relationship. Then you'll have a "Flag: Flag link" field.

It's mentioned in the short guide to using the Views integration.

mooffie’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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

siva.thanush’s picture

Version: 6.x-2.0-beta3 » 6.x-1.3

what to do when i have multiple flags for a node.
i.e., the view should display all the flag for that particular node.
when using "flag:node flag"relationship it asks for any one of the flag type.

mooffie’s picture

@t.sivasubramanian: when you reply in "closed" issues nobody sees you. Either "open" them or start a new issue.

the view should display all the flag for that particular node.

Simply add several relationships (for each flag).

Alternatively, use Flag Vista instead. It uses checkboxes instead of a radio button for selecting the flag. And it has a "Node: Flag link" field that makes it simpler to add these links (because you don't have to bring in the relationship first).

siva.thanush’s picture

Priority: Normal » Minor
Status: Closed (fixed) » Active

no i am not going to use flag vista because i almost finished my project. But thanks for the same.
Now i have tried that thing but its showing only one flag.

Relationships
Flags: like by current user
Flags: bookmark by current user

Fields
Node: Title
Flags: Flag link

Its showing

Title
like

When i add another "flags:flag link" in fields
its showing as

Title
like
like

mooffie’s picture

Status: Active » Fixed

When i add another "flags:flag link" in fields
its showing as

Title
like
like

That's because the second "Flags: Flag link" field you added thinks it belongs to the first relationship ("like"). Go to this field's settings screen. You'll see a "Relationship" dropdown. In it you'll see the two flag relationships. Select the other one.

Relationships
Flags: like by current user
Flags: bookmark by current user

BTW, you probably want to uncheck the "Include only flagged content" checkbox (in both relationships, or in one of them) or else the effect will be to show only nodes that are both liked and bookmarked.

siva.thanush’s picture

Status: Fixed » Active
StatusFileSize
new17.8 KB

Go to this field's settings screen. You'll see a "Relationship" dropdown. In it you'll see the two flag relationships.

The dropdown is listing nothing in it.
Giving u a screen shot.
i am already configured relationship as

Relationships
Flags: like by current user
Flags: bookmark by current user

as you said.
Look at my previous reply.
-
Thanks for helping me.

mooffie’s picture

That's weird.

It's good you provided a screenshot. Something is wrong there.

What version of Views are you using? And what version of Flag? Drupal 6 or 7?

Also, "export" your view and put it on pastebin.com, then provide the link.

(I have to go, but if I had a bit more time I'd have asked you to do a little test to make sure your Views isn't buggy: to bring in some other Drupal relationship (that isn't related to Flag) and see that Views correctly builds the "Relationships:" dropdown. if you understand what I ask, please do so. I'll be back next week.)

mooffie’s picture

Status: Active » Postponed (maintainer needs more info)

OK, here's a quick test to figure out if your Views otherwise works correctly:

- Start a "node" view.

- Add the "User: Nodes authored" relationship.

- Add the "Node: Title" field. Now, examine its "Relationship:" dropdown: is it populated?

(Another thing: Do you happen to have the "Flag Vista" module installed? Disable it and see if the problem's gone.)

siva.thanush’s picture

using drupal 6, view 6.x-2.1, flag 6.x-1.3.
http://pastebin.com/QBpMeRzM
check the view here.
and i am not using flag vista.

mooffie’s picture

I imported the view and I don't see a problem.

However, I noticed something:

A relationship has a label. You emptied the labels of two relationships. As a result, I see blank entries in the "Relationship:" dropdown. The dropdown *is* populated, but since it's populated with blanks you may have got the impression it isn't populated.

Edit the flag relationships: type something into the "Label:" box. Then examine the dropdown.

===

BTW, I see that Views is currently at 2.12. You're using 2.1, so you should upgrade. (I've tried your view on Views 2 "dev".)

==

You didn't follow the "test" I gave in comment #10. Let's hope the empty labels are the cause for your problem, but if they aren't: follow that test and let me know the results.

siva.thanush’s picture

Status: Postponed (maintainer needs more info) » Fixed

ya thanks moofie that was the problem.It was due to the empty label field.
Sorry for stealing your time.
i followed the test and i found that Relationships dropdown.
Then i figured out some label is missing but i was searching those
in flags configuration.
I will upgrade my views.
Thanks again for such wonderful module.]
-
Siva

Status: Fixed » Closed (fixed)

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

happysharma2’s picture

Title: Flag link in as a Field in Views » how to place flag link in view.
Version: 6.x-1.3 » 7.x-2.0
Status: Closed (fixed) » Needs review

I am new to drupal. i am working with flag module. i need your help thad how can i place a flag link(as a button) on view not on a node?

siva.thanush’s picture

You have to theme the flag link.
Bringing it in a view can be achieved using relationship.

joachim’s picture

Title: how to place flag link in view. » Flag link in as a Field in Views
Version: 7.x-2.0 » 6.x-1.3
Status: Needs review » Closed (fixed)

Please don't hijack old issues and change their settings.