The Flag module allows users or site visitors to mark posts and content to indicate preferences or options desired by the visitor. Once logged in, a site visitor can click on a link or image to Vote or “flag” an option. Click on this link to see how we used Flags for voting and picking sessions for the YaleSites DrupalCamp.
Here’s how we created those Flags:
- Enable the Flag module Modules > Flag and Flag actions.
- Configure the module in the following way:
- Structure > Flags > Add a new flag
- Give the Flag a Name (session_vote) and don’t change anything else.
- Provide a readable Name - Vote for a Session on the resulting page.
- Add message
- Indicate who can use the Flags (not available for Anonymous Users)
- Indicate the Content Type associated with the Flag
- Scroll down and Save. Additional changes are optional.
Adding the Flag to a View
- Create a view in a table format with the Content from the Bundle or Content Type you have chosen above.
- Create a relationship with the Flag (must be done first for the fields to show up).
- Add the Flag fields to the Fields section.
Using an Image to display rather than text
- Upload the following image to your site in any basic page.
- Enable CSS Injector (if it is not already enabled) and add the following CSS: