Add vendor name to the message button label

Hey,

Someone else recently asked about changing the ‘Reply to Listing’ text label that’s shown on the listing pages, which I helped resolve. However, it got me thinking of alternatives and I wondered if HivePress/Loco Translate allows us to use a variable label.

So, for example:

Listing A by ChrisB shows a button with “Message ChrisB”

Listing B by @ihor shows a button with “Message Ihor”

And, so on.

(If not, would this be possible with snippets to apply to the relevant profile and listing page buttons?)

Cheers,
Chris :victory_hand:

Hi,

Sorry for the delay,

It’s possible if you override this template part using a child theme hivepress-messages/templates/listing/view/page/message-send-link.php at master · hivepress/hivepress-messages · GitHub You can add the vendor name $listing->get_vendor__name() to the button label there.

Hope this helps

1 Like

You’re absolutely right—using Loco Translate is a great way to modify static text labels in HivePress. However, when it comes to dynamic content, like displaying the listing author’s name in the button label (e.g., “Message ChrisB”), Loco Translate doesn’t support this functionality.