Display rate widget in the page template using twig code block

Created on 19 April 2024, 9 months ago
Updated 15 September 2024, 4 months ago

Print rate widget using twig in the page template

Hi
This is not an issue but like to know how to print rate widget in the page template.
Added a rate widget(/admin/structure/rate_widgets) by the name rate_up_down and enabled the field in the manage display setting.

Tried following few methods to print the widget in the page template.

{{ content.rate_up_down }}
{{ content[rate_up_down] }}

& Using the pseudo field

{{ content.rate_widget }}
{{ content[rate_widget] }}

But the widget does not shows up.

The rate widget shows up only when i use {{ page.content }}

Thanks

πŸ’¬ Support request
Status

Closed: works as designed

Version

3.1

Component

Miscellaneous

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @shinkula
  • πŸ‡ΊπŸ‡ΈUnited States caesius

    Seems like you need to use the machine name of the widget as found at /admin/structure/rate_widgets i.e. rate_machine_name

    e.g. if the machine name is community_likes you would use content.rate_community_likes

  • Status changed to Closed: works as designed 4 months ago
Production build 0.71.5 2024