Score:1

Separate templates for flag links on views and node page

in flag

I have a flag called bookmark. The link to this flag is available on a View and the node page.

On the view, I would like this flag link to only display as an icon as the link.

On the node page, I would like this flag link to include an icon and some text (like Add to bookmarks")

When I create a custom template for it, like flag--bookmark.html.twig, this template alters the flag link in both (all) spots where the flag link is included.

Is there a way to have separate templates for the flag link when rendering in a view vs as a field in a node?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.