Automatically Adding Colored Notes in Articles Based on Article Keyword

7 Comments

  • Jessie Schutz
    Comment actions Permalink

    Awesome, Daniel, thanks for posting!

    0
  • Edwin Schukking
    Comment actions Permalink

    Hi Daniel,

    this would indeed be helpful for our end-users!

    Since we have a multi-language setup, would it also be possible to add more than one trigger word per class?

    Kind regards,
    Edwin

     

    0
  • Dan Cooper
    Comment actions Permalink

    Hi Edwin, 

    My example shows multiple keywords applying the same class. If you look at my last screenshot you can see that lines 131-133 are all setting keywords to have the same class applied to them.

    0
  • Rebecca McMurry
    Comment actions Permalink

    I love this idea. I tried this but I still have to go to the source and add the class. Any ideas why it might not be working? Here is what I added to CSS

    and JS

    0
  • Dan Cooper
    Comment actions Permalink

    Hi Rebecca, 

    There are a few things that might be working against you.  If you already have custom CSS setup it may conflict with what you've setup.  I ran mine on a mostly clear Copenhagen theme with minor changes. 

    Also, under your Guide Admin Settings you may need to enable the Display unsafe content checkbox to run scripts.  

    0
  • Rob Hearn
    Comment actions Permalink

    Hello Daniel,

    Following your example, I was only interested in using the "internal_note" so that I can use as a quick way of doing an internal tag for certain articles.

    I do not have any custom users set up just the default and so commenced to enter the settings for only "internal_note" into my .css and .js sections, as shown below:


    and

    After publishing both and whilst logged in as a manager I can see the internal notes on my kb article and the styling is working fine. However, if I sign out and view the same article I can still see the internal_note. I do not have any user or groups set up other than the default ones. Do you have any thoughts on why this is displaying regardless of whether I am logged in or not?

    0
  • Vladan Jovic
    Comment actions Permalink

    Hey Rob,

    try just to add

    display: none;

    under "p.internal_note {"

    1

Please sign in to leave a comment.

Powered by Zendesk