{"id":1352,"date":"2012-02-08T12:13:13","date_gmt":"2012-02-08T11:13:13","guid":{"rendered":"http:\/\/www.itidea.nl\/?p=1352"},"modified":"2015-09-08T20:36:30","modified_gmt":"2015-09-08T18:36:30","slug":"empty-tooltip-in-refinement-panel","status":"publish","type":"post","link":"https:\/\/www.itidea.nl\/index.php\/empty-tooltip-in-refinement-panel\/","title":{"rendered":"Empty tooltip in refinement panel"},"content":{"rendered":"<p>Sometimes when hovering over a fieldvalue in the refinementpanel the tooltip displays only &#8216;Refine By:&#8217; without displaying any value.<br \/>\n<a href=\"https:\/\/www.itidea.nl\/wp-content\/uploads\/2012\/02\/EmptyTooltipRefinementPanel01.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1353\" title=\"EmptyTooltipRefinementPanel\" src=\"https:\/\/www.itidea.nl\/wp-content\/uploads\/2012\/02\/EmptyTooltipRefinementPanel01.png\" alt=\"EmptyTooltipRefinementPanel\" width=\"140\" height=\"157\" \/><\/a><\/p>\n<p>While another displays an actual value:<br \/>\nActual term in a tree<br \/>\n<a href=\"https:\/\/www.itidea.nl\/wp-content\/uploads\/2012\/02\/EmptyTooltipRefinementPanel02.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1354\" title=\"Actual term in a tree\" src=\"https:\/\/www.itidea.nl\/wp-content\/uploads\/2012\/02\/EmptyTooltipRefinementPanel02.png\" alt=\"Actual term in a tree\" width=\"248\" height=\"163\" \/><\/a><\/p>\n<p>or just a &#8216;parent&#8217; term<br \/>\n<a href=\"https:\/\/www.itidea.nl\/wp-content\/uploads\/2012\/02\/EmptyTooltipRefinementPanel03.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1355\" title=\"Parent term\" src=\"https:\/\/www.itidea.nl\/wp-content\/uploads\/2012\/02\/EmptyTooltipRefinementPanel03.png\" alt=\"Parent term\" width=\"501\" height=\"168\" srcset=\"https:\/\/www.itidea.nl\/wp-content\/uploads\/2012\/02\/EmptyTooltipRefinementPanel03.png 501w, https:\/\/www.itidea.nl\/wp-content\/uploads\/2012\/02\/EmptyTooltipRefinementPanel03-300x100.png 300w\" sizes=\"auto, (max-width: 501px) 100vw, 501px\" \/><\/a><\/p>\n<h3>Why?<\/h3>\n<p>When the fieldvalue is less than 19 characters the tooltip stays empty. Well empty.. it displays &#8216;Refine By:&#8217;. Every fieldvalue with more than 19 characters is displayed in the tooltip. A &#8216;parent&#8217; term or a whole path.<\/p>\n<h3>How to solve?<\/h3>\n<p>This behavior can be solved by adjusting the xslt.<\/p>\n<p>Original xslt:<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;a href=&quot;{$SecureUrl}&quot; title=&quot;{$RefineByHeading}: {$UrlTooltip}&quot;&gt;\r\n&lt;xsl:value-of select=&quot;Value&quot;\/&gt;\r\n&lt;\/a&gt;\r\n<\/pre>\n<p>Adjusted xslt:<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;xsl:variable name=&quot;UrlTooltipAdjusted&quot;&gt;\r\n &lt;xsl:call-template name=&quot;format-tooltip&quot;&gt;\r\n &lt;xsl:with-param name=&quot;tooltip&quot; select=&quot;$UrlTooltip&quot; \/&gt;\r\n &lt;xsl:with-param name=&quot;string&quot; select=&quot;Value&quot; \/&gt;\r\n &lt;\/xsl:call-template&gt;\r\n&lt;\/xsl:variable&gt;\r\n\r\n&lt;a href=&quot;{$SecureUrl}&quot; title=&quot;{$RefineByHeading}: $UrlTooltipAdjusted}&quot;&gt;\r\n&lt;xsl:value-of select=&quot;Value&quot;\/&gt;\r\n&lt;\/a&gt;\r\n\r\n&lt;xsl:template name=&quot;format-tooltip&quot;&gt;\r\n &lt;xsl:param name=&quot;tooltip&quot; \/&gt;\r\n &lt;xsl:param name=&quot;string&quot; \/&gt;\r\n &lt;xsl:choose&gt;\r\n &lt;xsl:when test=&quot;$tooltip != ''&quot;&gt;\r\n &lt;xsl:value-of select=&quot;$tooltip&quot; \/&gt;\r\n &lt;\/xsl:when&gt;\r\n &lt;xsl:otherwise&gt;\r\n &lt;xsl:value-of select=&quot;$string&quot; \/&gt;\r\n &lt;\/xsl:otherwise&gt;\r\n &lt;\/xsl:choose&gt;\r\n&lt;\/xsl:template&gt;\r\n<\/pre>\n<p>The &#8216;format-tooltip&#8217; template checks if the tooltip is empty and replaces the tooltip value with the actual fieldvalue if so.<br \/>\nBy doing this the tooltip will never be empty and will always show the value of the fieldvalue.<br \/>\n<a href=\"https:\/\/www.itidea.nl\/wp-content\/uploads\/2012\/02\/EmptyTooltipRefinementPanel04.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1356\" title=\"Tooltip shows value\" src=\"https:\/\/www.itidea.nl\/wp-content\/uploads\/2012\/02\/EmptyTooltipRefinementPanel04.png\" alt=\"Tooltip shows value\" width=\"198\" height=\"153\" \/><\/a><\/p>\n<h3>Summary<\/h3>\n<p>Besides the fieldvalues also the tooltip values suffer from a character limitation. The values of the refinement panel have a 19 character display limit, the tooltip doesn&#8217;t display the value when the fieldvalue is less than 19 characters.<br \/>\nThis and the <a href=\"https:\/\/www.itidea.nl\/index.php\/refinement-panel-character-display-limitation\/\">previous post<\/a> solve these issues by making minor adjustments to the OOTB xslt.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes when hovering over a fieldvalue in the refinementpanel the tooltip displays only &#8216;Refine By:&#8217; without displaying any value. While another displays an actual value: Actual term in a tree or just a &#8216;parent&#8217; term Why? When the fieldvalue is &#8230; <a class=\"more-link\" href=\"https:\/\/www.itidea.nl\/index.php\/empty-tooltip-in-refinement-panel\/\">Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[42,34],"class_list":["post-1352","post","type-post","status-publish","format-standard","hentry","category-sharepoint-2010","tag-sharepoint-2010","tag-xslt"],"_links":{"self":[{"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/posts\/1352","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/comments?post=1352"}],"version-history":[{"count":4,"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/posts\/1352\/revisions"}],"predecessor-version":[{"id":1360,"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/posts\/1352\/revisions\/1360"}],"wp:attachment":[{"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/media?parent=1352"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/categories?post=1352"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/tags?post=1352"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}