Adding text to feedback buttons

Hi team,
I am trying to add feedback buttons to FAQ cards with a text next to them (e.g. ‘Was this helpful?’)

I’ve managed to add the feedback buttons but am wondering on how to add the text next to them. I have seen this image from a client that doesn’t seem to be live anymore but this looks like what I am trying to achieve.
Thanks!

Hey Max,

There is a way to add text next to the feedback buttons using the theme. You can add the data mapping feedbackText to the card’s component.js file and set it to the text you want to display next to the buttons.

For more detail on why this works:
Following these instructions to add feedback buttons, the functionality for these buttons is in the file themes/answers-hitchhiker-theme/cards/common-partials/thumbsfeedback.hbs. Navigating to this file, you’ll see that there’s a Handlebars expression for {{feedbackText}} on line 62 below. When the template is executed by the card, this expression will be replaced by the value we provide in the component.js file. There are Handlebars expressions in this screenshot for feedbackTextOnSubmission and positiveFeedbackSrText, which are in the card component.js file by default.

Add the data mapping feedbackText to the component.js file and set it to the text you want to display next to the buttons.

1 Like