YES!!!!! That sorted it! I had to also apply the ?size?number to the kudosCount within the output too and it is now working!
Thank you so much for sticking with me on this one. I have learned a bit more thanks to you!
Here is the final version of the code:
<#assign messageId = env.context.message.uniqueId />
<#if messageId?? && messageId gt 0>
<#assign apiVersion = "2.0"/>
<#assign cutoff = 10 />
<#assign counter = 0 />
<#attempt>
<#assign users = rest("/messages/id/${messageId}/kudos/givers?page_size=${cutoff}").users />
<#recover>
<#assign users = "" />
</#attempt>
<#attempt>
<#assign kudosCountFirst = rest("/messages/id/${messageId}/kudos/count").value />
<#assign kudosCount = rest(apiVersion,"/search?q=" + "SELECT * FROM kudos where message.id = '${messageId}' limit ${kudosCountFirst}"?url).data.items![] />
<#recover>
<#assign kudosCountFirst = "" />
<#assign kudosCount = "" />
</#attempt>
<#assign remaining = kudosCount?size?number - cutoff?number />
<#if users??>
<#if kudosCount?size?number gte 1 ><span class="kudosgivers hidden">${kudosCount?size?number} <#if kudosCount?size?number == 1>user<#else>users</#if> liked/thanked this post:
<#list users.user as kudosGiver><#assign counter = counter+1 />${kudosGiver.login}<#if counter?number == cutoff?number && kudosCount?size?number gte cutoff?number+1>... and ${remaining} other <#if remaining == 1> user<#else>users</#if>. <#else><#if counter?number == kudosCount?size?number>. <#else>, </#if></#if></#list>
<#if kudosCount?size?number gte cutoff?number+1 >Click the number to view who else liked/thanked this post.</#if></span></#if>
</#if>
</#if>
And for anyone interested in applying this to their own Kudos element, here is the javascript to inject it into the link to the kudos page:
<@liaAddScript>
;(function($) {
$(".kudosgivers").each(function() {
var $kudosgivers = $(this);
$kudosgivers.parent().find('.kudos-count-link').attr('title', $kudosgivers.text());
$(this).remove();
});
})(LITHIUM.jQuery);
</@liaAddScript>
Thanks TariqHussain, you're awesome :)