Recent searches


No recent searches

Can I have a different image for og:image property, depending on the user language?

Answered


Posted Oct 26, 2021

Hi,

Our support site is in different languages and I would like to have a localised banner for each property. Is this possible? Currently all languages in my support site have an og:image that has English copy on it, which doesn't make sense for non-EN users. Thanks!


0

2

2 comments

image avatar

Tipene Hughes

Zendesk Developer Advocacy

Hey Jack,

Thanks for reaching out!

You can absolutely have localized images in your help centers. The best way to achieve this would be using dynamic content.

What you’ll need to do is create the dynamic content for the various languages your help center supports, and then add a dynamic content helper to the handlebars file of the page(s) you want to update.

The dynamic content you’ll want to add will vary depending on where you’re updating the image. For example, the hero image is set via the background-image property in the style.css file. Since the style.css file does not support handlebars template expressions, you’ll need to first remove the background-image property from the class selector in the style.css file, and then add the background-image and dynamic content helper as an inline style

Dynamic content:
url(https://exampleImage.com)

HTML with inline style and helper:

<section id="main-content" class="section hero" style="background-image: {{dc 'header'}}">

Again, depending on where the image is being added, the format of the dynamic content may need to be set differently.

Here’s a couple of articles that go into a bit more depth on the topic:

https://support.zendesk.com/hc/en-us/articles/4408894121754

https://developer.zendesk.com/documentation/help_center/help-center-templates/helpers/#dc-dynamic-content-helper

I hope this helps! Feel free to reach out with any questions.

Tipene

1


Hello Tipene Hughes

Thanks for the response above. I was just looking into something similar, and I had a question.

I would like to use my own og:image image for sharing a Guide article link in social media, email or MS Teams, etc.

The suggestion you provided above using dynamic content applies to the og:image for a shared link as well? or just to image content within pages?

Currently, the og:image is using our logo image as the default.

I think my issue is more related to this community post, which has been closed for comments: Is there a way to customize image that appears when a Guide ink is shared to social media?

Do you know if any headway has been made regarding this requirement?

Thank you

Merav

 

0


Please sign in to leave a comment.

Didn't find what you're looking for?

New post