Forum Discussion

PerBonomi's avatar
12 years ago

Linked posts are highlighted, idea comments aren't

Re: http://lithosphere.lithium.com/t5/customer-connection/Message-with-yellow-highlight-background/m-p/12542/highlight/true#M834

 

I managed to get posts that are linked to, to highlight, using

 

 

#lia-body .lia-content .lia-message-view .lia-effect-highlight {
background-color: #ecebe8;
}

Example.

 

Unfortunately, this doesn't seem to affect a linked comment in an idea thread. Example.

 

I checked the source code of the page of directly linked idea comment and saw that there is no "lia-effect-highlight" anywhere. Which might explain why idea comments aren't being highlighted.

 

How do I get highlights working for idea comments?

 

 

1 Reply

  • DougS's avatar
    DougS
    Khoros Oracle
    12 years ago

    Unfortunately the message highlighting functionality is not there for ideas.  However, you could implement a customization to do this via Studio.  Here's what you could do in Studio:

     

    1. Go to the components tab and add a component named "idea-comment-highlighter".
    2. Add the following markup to the component and save it (the @liaAddScript directive will add some javascript to the bottom of the page, so it runs after the DOM has loaded):

       

    3. <#if page.context.message??>
        <#if (page.context.message.discussionStyle == "idea") && (env.context.message??)>
          <#if env.context.message.uniqueId == page.context.message.uniqueId>
            <@liaAddScript>
              ;(function($) {
                $(".lia-js-data-messageUid-${env.context.message.uniqueId}").addClass("lia-effect-highlight");
              })(LITHIUM.jQuery);
            </@liaAddScript>
          </#if>
        </#if>
      </#if>

       

    4. Go to the pages tab and open the "Comment Message" page.
    5. Add the "idea-comment-highlighter" custom component to the page (it doesn't have any ui, just adds some javascript if it's an idea comment and the message id of the comment matches the message id in the url so should be able to add it to any of the columns on the page).

    Use at your own risk (and make sure you test).  Hope that helps!

     

    -Doug