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

XF 1.1 Preview Tool Tips Not Loading

Discussion in 'Troubleshooting and Problems' started by Jake Hakoda Shirley, May 27, 2012.

  1. Jake Hakoda Shirley

    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?
  2. Jake Hakoda Shirley

    Jake Hakoda Shirley Active Member

    I know this is in poor taste, as it is a double post, but I really need a solution to this issue.

    You can see an example of what is happening here by hovering your mouse over any row in the table:

    The way I am displaying the tool tips is like so:
    class="PreviewTooltip" data-previewurl="http://www.google.com/"
  3. Jeremy P

    Jeremy P Well-Known Member

    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.jpg
  4. Jake Hakoda Shirley

    Jake Hakoda Shirley Active Member

    Thanks for the reply!

    I tried using this from another thread:
    <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?
  5. Jeremy P

    Jeremy P Well-Known Member

    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:
    = array('templateHtml' => '<div class="previewTooltip">Tooltip content</div>');
    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.

Share This Page