• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.2 How to add these tooltips

Chris D

XenForo developer
Staff member
#2
Your posts always lack the necessary information we need to help you... The HTML of the 11/12 would be helpful. In absence of that, I'll guess:

If the HTML currently looks like:

Code:
<div class="counts">11/12</div>
You'd need to change it to something like:

Code:
<div class="counts">
     <span class="Tooltip" title="{xen:phrase discussions}">11</span>/<span class="Tooltip" title="{xen:phrase messages}">12</span>
</div>
 

Matthew Hawley

Well-known member
#3
Your posts always lack the necessary information we need to help you... The HTML of the 11/12 would be helpful. In absence of that, I'll guess:

If the HTML currently looks like:

Code:
<div class="counts">11/12</div>
You'd need to change it to something like:

Code:
<div class="counts">
     <span class="Tooltip" title="{xen:phrase discussions}">11</span>/<span class="Tooltip" title="{xen:phrase messages}">12</span>
</div>
Code:
<dl><dt><i class="icon-comment"></i></dt> <dd>{xen:if $forum.privateInfo, '&ndash;', {xen:number $forum.discussion_count}}/{xen:if $forum.privateInfo, '&ndash;', {xen:number $forum.message_count}}</dd></dl>
 

Chris D

XenForo developer
Staff member
#5
Thanks Chris, it worked!
Code:
<dl><dt><i class="icon-comment"></i></dt> <dd>{xen:if $forum.privateInfo, '&ndash;', '<span class="Tooltip" title="{xen:phrase discussions}">'}/{xen:if $forum.privateInfo, '&ndash;', <span class="Tooltip" title="{xen:phrase messages}">{xen:number $forum.message_count}</span>}</dd></dl>
Good. I made my code above more specific to your example just for clarity.
 

Matthew Hawley

Well-known member
#6
Code:
<dl><dt><i class="icon-comment"></i></dt> <dd>{xen:if $forum.privateInfo, '&ndash;', '<span class="Tooltip" title="{xen:phrase discussions}">'}/{xen:if $forum.privateInfo, '&ndash;', <span class="Tooltip" title="{xen:phrase messages}">{xen:number $forum.message_count}</span>}</dd></dl>
Good. I made my code above more specific to your example just for clarity.
The following templates contained errors and were not saved: node_forum_level_2: 1) Line 20: Template syntax error.
 

Chris D

XenForo developer
Staff member
#7
Code:
<dl><dt><i class="icon-comment"></i></dt> <dd>{xen:if $forum.privateInfo, '&ndash;', '<span class="Tooltip" title="{xen:phrase discussions}">'}/{xen:if $forum.privateInfo, '&ndash;', '<span class="Tooltip" title="{xen:phrase messages}">{xen:number $forum.message_count}</span>'}</dd></dl>
Sorry missed the ' ' around the second span.