XF 1.1 Preview Tool Tips Not Loading

Jake Hakoda Shirley

Active member
So for what ever reason, none of my preview tool tips are loading (for me at least). They just sit there and say 'Loading....' forever.

Anyone have any idea why this might be?
 
The preview url can't return just any data I don't think, XenForo expects a JSON response with a templateHtml string/value pair.

The preview for this thread returns like this:
Screen Shot 2012-05-27 at 1.15.54 PM.webp
 
The preview url can't return just any data I don't think, XenForo expects a JSON response with a templateHtml string/value pair.

The preview for this thread returns like this:
View attachment 30023

Thanks for the reply!

I tried using this from another thread:
Code:
<a href="{xen:link members, $user}" class="PreviewTooltip" data-previewurl="{xen:link full:members/card, $user}">{$user.username}</a>

That is from this thread and I would assume that it is supposed to work.

Anyways, thanks your help thus far!


EDIT: Never mind, I guess it works! Thanks so much!

One more question, do you think you could point me in the right direction of examples of custom JSON responses for tool tips?
 
It's worth noting that if you make use of the XenForo addon system (and corrosponding MVC architecture) it does a lot of the leg work for you. It can take time to learn but it's worth it.

That said, something like this should get you started:
PHP:
<?php
 
$data = array('templateHtml' => '<div class="previewTooltip">Tooltip content</div>');
 
echo json_encode($data);

Saving that PHP script somewhere web accessible and using it as your preview URL should put the content of $data['templateHtml'] in your tooltip. Obviously this is just a simple example.
 
Top Bottom