Guide Article - How to show date and author only to Team Members | Community
Skip to main content

Guide Article - How to show date and author only to Team Members

  • May 4, 2023
  • 2 replies
  • 0 views

Franca

Hello,

please could anybody explain me how to update the template article_page.hbs so that the contents of class="article-author" (author name, last updated date, etc.) are visible only to staff members, not to external users?

Many thanks,

Franca

2 replies

Zsa
  • May 9, 2023

Hello Franca,

This seem to be possible thru JS customization. You can add the following lines on your script.js template:

// Hide article-author div for non-agents
if (HelpCenter.user.role=="anonymous"){
$("div.article-author").hide();
}
if (HelpCenter.user.role=="end_user"){
$("div.article-author").hide();
}

Please do note, the above code is provided without warranty or guarantee that it will continue to function as the product changes.


Franca
  • Author
  • May 9, 2023

Hi Zsa,

thank you for your precious help!