I want to add an "Add to favorite" system for my users to my website using the Flag module in Drupal 8.

But I can't print "Add to favorite" link into my custom Twig template.

marked as duplicate by DRUPWAY, leymannx, Beebee, sanzante, Yusef Mohamadi May 30 '18 at 21:25

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    @Darvanen: Did you add this possible duplicate by mistake? The questions don’t seem to be related. – unor May 11 '18 at 8:36
  • Um yep, that's not what I thought I was choosing – Darvanen May 12 '18 at 9:45

By using flag project and print the field in my page I could do that. And then I created a view block and printed it into user page.

{{ content.flag_bookmark }}

Then I've override the twig file for this module.

Not the answer you're looking for? Browse other questions tagged or ask your own question.