Hi,

i'm trying to a "Add Friend" flag into an area of the user account layout. Flags only appear in Main page content, but i'm not using Main page content.

How can flags become layout blocks?

Accepted answer

An (imperfect) solution is to: (EDITED)

  1. Install and enable Token Block
  2. Override the user/% layout
  3. Add a Token Block ("Tokens for user entities") to any of the layout regions of that layout and enter [user:flag-add-as-friend-link] in its body, for a flag with a machine name add_as_friend (notice that the _ is changed to -). This will show the link to flag that node

This will work only for flags that use "Normal link" instead of "JavaScript toggle" in the flag configuration UI.

NOTE: you may need to clear caches after creating the user flag type.

Comments

An (imperfect) solution is to: (EDITED)

  1. Install and enable Token Block
  2. Override the user/% layout
  3. Add a Token Block ("Tokens for user entities") to any of the layout regions of that layout and enter [user:flag-add-as-friend-link] in its body, for a flag with a machine name add_as_friend (notice that the _ is changed to -). This will show the link to flag that node

This will work only for flags that use "Normal link" instead of "JavaScript toggle" in the flag configuration UI.

NOTE: you may need to clear caches after creating the user flag type.

Yes, this is exactly it. It's such a classic module i was wondering why it couldn't do that out of the box. Thanks a lot!

Edit: Reply to argiepiano, accepted answer!