Why are Likes missing from Forum replies?

Someone may want to like a response, but not necessarily up-vote it.  Essentially, thanks for the reply.

Is there somewhere the widget can be configured to add this capability.

Else, I presume this could be added with custom widget dev using the 'Like REST Endpoints'.

  • Adding back likes would be a relatively simple widget change using $core_v2_ui.Like(). See the comments widgets for examples. Likes were removed be default from forum replies when the voting mechanism was added, since they fulfill very similar purposes.

  • Thanks for the quick reply Steven.  I will take a look at the comments widget.

  • I have been looking at the code and found only one place in the comments list widget under common-rendered-reply-body.vm just under the votes.

    <li class="navigation-list-item">
    	#if ($accessingUserIsRegistered)
    		#set ($likeFormat = '{toggle} {count}')
    	#else
    		#set ($likeFormat = '{count}')
    	#end
    	$core_v2_ui.Like($comment.CommentId, $comment.CommentContentTypeId, "%{ Format = $likeFormat, IncludeTip = 'true' }")
    </li>				

    I took this and added to similar section in Forums - Thread under same vm, but not sure how to configure it.  I have tried th following, but it has not impact.

    <li class="navigation-list-item">
        #if ($accessingUserIsRegistered)
        	#set ($likeFormat = '{toggle} {count}')
    	#else
    		#set ($likeFormat = '{count}')
    	#end
     	$core_v2_ui.Like($forumReply.Id, $forumReply.ContentTypeId, "%{ Format = $likeFormat, IncludeTip = 'true' }")
    </li>	

    Not sure why it is not working.  Did I miss something?

  • Try using $forumReply.ContentId instead of $forumReply.Id.

  • Here are the final changes made to common-rendered-reply-body.vm with the Forum Thread widget.

    		## extra link to support showing the custom 'more' link
    		#if ($isRegistered)
    		    ## Modified to accommodate adding back likes
    		    ## Changed to 2 from 1
    		    #set ($maxLinks = $maxLinks + 2)
    		#end
    
    		#set ($replyActionsId = $core_v2_widget.UniqueId("replyActions-${forumReply.ContentId}"))
    
    		<div class="navigation-list ui-links" data-maxlinks="$maxLinks" data-direction="horizontal">
    			<ul>
    				## Quality Votes
    				#if (!$forumReply.IsDeleted)
    					<li class="navigation-list-item vote">
    						<span class="votes">
    							#set ($currentVotes = $forumReply.QualityYesVotes)
    							#set ($currentVotes = $currentVotes - $forumReply.QualityNoVotes)
    							#set ($forumReplyVote = false)
    
    							#if ($accessingUserIsRegistered)
    								#set ($forumReplyVote = $core_v2_forumReplyVote.Get($forumReply.Id, "%{ VoteType = 'Quality' }"))
    							#end
    
    							#if ($accessingUserIsRegistered)
    								<a href="#" data-tip="$core_v2_encoding.HtmlAttributeEncode($core_v2_language.GetResource('vote_up'))"class="ui-tip vote up #if ($forumReplyVote && $forumReplyVote.Value) selected #end" data-messagename="ui.replies.vote.message" data-replyid="$forumReply.Id" data-value="true">$core_v2_language.GetResource('up')</a>
    							#else
    								<a href="#" data-tip="$core_v2_encoding.HtmlAttributeEncode($core_v2_language.GetResource('vote_up'))" class="ui-tip vote up" data-messagename="telligent.evolution.widgets.thread.login" data-replyurl="$core_v2_encoding.HtmlAttributeEncode($forumReply.Url)">$core_v2_language.GetResource('up')</a>
    							#end
    
    							<span class="vote current ui-tip" data-tip="$core_v2_encoding.HtmlAttributeEncode($core_v2_language.GetResource('view_voters'))" data-replyid="$forumReply.Id">$currentVotes.ToString("+0;-0;0")</span>
    
    							#if ($accessingUserIsRegistered)
    								<a href="#" data-tip="$core_v2_encoding.HtmlAttributeEncode($core_v2_language.GetResource('vote_down'))" class="ui-tip vote down #if ($forumReplyVote && !$forumReplyVote.Value) selected #end" data-messagename="ui.replies.vote.message" data-replyid="$forumReply.Id" data-value="false">$core_v2_language.GetResource('down')</a>
    							#else
    								<a href="#" data-tip="$core_v2_encoding.HtmlAttributeEncode($core_v2_language.GetResource('vote_down'))" class="ui-tip vote down" data-messagename="telligent.evolution.widgets.thread.login" data-replyurl="$core_v2_encoding.HtmlAttributeEncode($forumReply.Url)">$core_v2_language.GetResource('down')</a>
    							#end
    						</span>
    					</li>
    				#end
    				## Reply Link
    				#if ($hasReply)
    					<li class="navigation-list-item">
    						#if ($hasReplyPermission)
    							<a href="#" class="internal-link new-reply"
    								data-label-reply="$core_v2_encoding.HtmlAttributeEncode($core_v2_language.GetResource('reply'))"
    								data-label-cancel="$core_v2_encoding.HtmlAttributeEncode($core_v2_language.GetResource('cancel'))"
    								>$core_v2_language.GetResource('reply')</a>
    						#elseif ($userMustLogin)
    							<a href="#" class="primary internal-link login" data-messagename="telligent.evolution.widgets.thread.login" data-replyurl="$core_v2_encoding.HtmlAttributeEncode($forumReply.Url)">$core_v2_language.GetResource('reply')</a>
    						#end
    					</li>
    					## Add Likes Back
    					<li class="navigation-list-item">
    					    #if ($accessingUserIsRegistered)
    					    	#set ($likeFormat = '{toggle} {count}')
    				    	#else
    				    		#set ($likeFormat = '{count}')
    				    	#end
    				     	$core_v2_ui.Like($forumReply.ContentId, $forumReply.GlobalContentTypeId, "%{ Format = $likeFormat, IncludeTip = 'true' }")
        				</li>	
        				## End Add Likes Back
    				#end

    Had to use .ContentId and GlobalContentTypeId with $core_v2_ui.Like entry to get it to show the item, and also added after the reply section (spacing issue with Reply button if added before reply).