Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Views Bootstrap 5.5.4 — Minor update available for module views_bootstrap (5.5.4). Release: Download Tracker 1.0.7 — Minor update available for module download_tracker (1.0.7). Release: Directory2Block Slideshow 1.0.8 — Minor update available for module directory2block_slideshow (1.0.8). Release: Mautic Audiences 1.1.5 — Minor update available for module mautic_audiences (1.1.5). Release: Rightup theme 1.0.3 — Minor update available for theme vartheme_bs5_rightup (1.0.3). Release: CommentOn 1.0.6 — Minor update available for module commenton (1.0.6). Release: ChatGPT Ads 1.0.3 — Minor update available for module chatgpt_ads (1.0.3). Release: Opensolr Search 5.1.3 — Minor update available for module opensolr_search (5.1.3). Module Revived: Swagger-PHP OpenAPI 3 documentation generator 1.0.0 — Module swagger_php updated after 10 months of inactivity (1.0.0). Security Coverage: Microsoft Azure AI — Module ai_provider_azure now has official Drupal security advisory coverage.

Flag anonymous

Security covered

Part of the Flag ecosystem · 8 projects

View on drupal.org

πŸ‡ΊπŸ‡¦

This module is maintained by Ukrainian developers.
Please consider supporting Ukraine in a fight for their freedom and safety of Europe.

Module provides ability:

  • Show configurable message "Login or Register to use this flag" to anonymous users instead of flag link
  • Show original flag label, on click: Display popin with message "Login or Register to use this flag", Drupal 8 version
  • Open Login and Registration form in popup (with ability to tune Login and Registration popups settings), Drupal 8 version
  • Automatically "Flag" entity with clicked flag after successful Login or Registration

Basic usage

Flag anonymous module helps you to show existing "flagging" ability to anonymous users and motivate them to login or register in a simple way (on the same page using popup).

Requirements

Installation

  • Install the module to:
    • Drupal 7: sites/all/modules/contrib or sites/all/modules
    • Drupal 8: modules/contrib or modules
      or with Composer: $ composer require 'drupal/flag_anon:^1.0'
  • Enable Flag anonymous module

Configuration (Drupal 8)

  • Go to a Flags list page /admin/structure/flags
  • Click "Edit" link on Flag which you'd like to configure
    • Or click "Add flag" button if you'd like to add a new Flag
  • Scroll down flag edit page to "Anonymous settings" section
  • Check "Show this flag to anonymous users even if they don't have permission to use it." checkbox to enable module functionality.
    • IMPORTANT NOTE: Anonymous users shouldn't have Flag/Unflag permission for currently edited flag (shouldn't be able to use this flag). If anonymous users have Flag/Unflag permission remove it using /admin/people/permissions#module-flag page, otherwise module functionality will be blocked.
  • Choose "Label display" option:
    • "Keep original flag label (show Message on click)" - in this case original flag label will be displayed. On click by it: Popin with "Login or Register to use this flag" message will be displayed.
      • Set "Dialog message title" - it's a title of Popin with "Login or Register to use this flag" message. Leave blank to have empty Popin title.
    • "Show Message instead of flag label" - in this case flag label will be replaced with "Login or Register to use this flag" message.
  • Set "Message" - it's a "Login or Register to use this flag" message. You can use: @login - Login link, @register - Registration link placeholders there.
  • Set "Login link label" - a label for Login link placeholder.
  • Set "Register link label" - a label for Registration link placeholder.
  • Check "Show Login and Registration form in popup." checkbox if you'd like to show Login and Registration forms in Popup on click by "Login" or "Register" links
    • "Login popup settings" - Login popup settings for data-dialog-options attribute. Valid JSON should be used like: {"width": "auto"}
    • "Register popup settings" - Registration popup settings for data-dialog-options attribute. Valid JSON should be used like: {"width": "auto"}
  • Fill or change other needed fields and click "Save Flag" button.

For developers

To add custom placeholders into configurable "Login or Register to use this flag" message implement hook_flag_anon_message_placeholders_alter() and add additional placeholders there (see more details in flag_anon.api.php file).

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Jul 2023
Latest release
3 years ago
Releases (12 mo)
0
Maintenance
Dormant

Releases

Version Type Core Release date
8.x-1.1 Stable Jul 7, 2023