How to show article labels?
Is there a way to show the list of labels in the article page? I can't seem to find a template component for it. Thanks
-
Hi Lance!
There isn't a component that you can add to display this information; it would need to be added manually to the body of the article itself.
Hope that helps!
-
What is the purpose of labels in Articles if you must add content to the body of the article for it to be picked up in searches?
I am adding content to labels and when I "save/update" the content is deleted. Is this a bug?
-
HeyO Melanie,
Labels within articles can serve as a method of prioritizing certain articles over other when searching. For instance, if I have two articles about making waffles, one with the word "temperature" in the body of the article, one with the label "temperature", the labeled article will be ranked higher if a user searches for the word "temperature".
For information on adding labels to articles, please see this article. If you still have issues with labels, I'd be happy to create a ticket for you, or you could email us at support@zendesk.com
-
I agree that this would be a helpful feature. Even if you could allow us to customize the HTML and insert them (maybe there is already a way to do this?). This is important because if I am editing a large number of articles and tagging them, I don't want to have to go into edit mode to see what tags have already been applied.
-
Hi Samantha!
I checked with one of our Help Center Product Champions, and it is possible to add the article labels so they're visible using the new Curlybars templating language. The caveat to that is that what we came up with on the fly isn't pretty, so you'll need to do some additional custom formatting to make it look nice.
Here's the basic code:
{{#each article.labels}}{{identifier}}{{/each}}
That'll at least get you started. Please let me know if you have any other questions!
-
Thanks for the code Jessie! It works perfectly.
-
Thank you, Jessie!
-
I'm glad it helped! :D
-
Can someone give me a good example of where to put that code and what the expected result should be? Thanks.
-
Hi David,
That code could be placed into the Article page within your Help Center customization. As shown above, the code would list the labels one after another, so if a given article had the labels "support", "faq", and "account-related", it would display as "supportfaqaccount-related".
For a slightly prettier format, you could use the following:
Labels: {{#each article.labels}}{{identifier}}, {{/each}}
which would print "Labels: " followed by each label for the current article separated by commas.
If you have issues setting this up, please feel free to reach out to support@zendesk.com so we can help you within a ticket.
Thanks!
-
@David - I have some code here that will do some formatting of the labels.
https://gist.github.com/moderatorwes/0dba5d1855e2edf61487a0e94c1ac85d
-
Wes - Very nice! :-)
-
Hi Guys,
i have tried to follow your steps and simply add this code to the Source code editor however, it is just showing the mark up. i have a real urgent requirement to add the labels i have defined onto an article so they are visible for our help centre users.
Can someone help ASAP?
-
Hey Joe!
Can you post a screenshot of the code in your editor, and how it's appearing in your Help Center?
In the meantime I'll try to track down Wes or someone else who can help you sort this out!
-
@Joe - Can you post a link to your Help Center if its open to the public so I can see what code you have.
-
I just tested Wes' solution and it works beautifully for me.
@Joe
I suspect something isn't being dropped in its proper place, so let me explain how I did it.- Copy Wes' article.html and insert it in the article template. I entered it below the body (see below), but you might wan't to put it above.
- Next copy the zendesk.css and paste it anywhere in the CSS. Like so:
Hope that helps you out.
- Copy Wes' article.html and insert it in the article template. I entered it below the body (see below), but you might wan't to put it above.
-
Nice Jacob and Wes! That looks good!
(Anybody want to write it up as a Tip!? For swag? If Jacob does it, I'll give Wes swag too of course. :)
-
Did it, high-five Wes!
-
The tip looks great, Jacob! Thanks for writing it up.
I'll send some swag your way! And Wes's way too.
-
Can anybody give me an example trigger email for answer bots?
This is what my trigger looks like:
The email looks like the following:This is my list of articles:
I have saved article label list on articles named "transactions"
I'm having a hard time getting my answer bot to show in the emails as shown above. Any tips or assistance would be greatly appreciated.
Lean
-
Much appreciation to everyone in this thread for all the help. I was able to hack together my own way to display a specific logo for some of the product brands we're supporting on our site based on the labels. It took me a bit to figure out the right syntax for the handlebars helper. Here's my code in case it can help someone else in the future (additional CSS work required):
-
Thanks for coming back and showing us what you came up with, Cody!
-
Sorry, I am new to this.
From the code: {{#each article.labels}}{{identifier}}{{/each}}, how can the article title with hyperlink with same labels show up on the webpage?
-
Hey Angeli,
You may use {{article.title}} to get the title of the article you're currently viewing. I believe what you're trying to achieve here is to be able to filter articles based on label(s) on the Category and Section level. I'm afraid that's currently unsupported because the article label object is restricted to the Article page. To learn more about the properties available on each page template, please see Help Center Templates.
Please let me know if you need further assistance!
Vous devez vous connecter pour laisser un commentaire.
24 Commentaires