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

How To Edit Thread Preview Hover?

Discussion in 'Styling and Customization Questions' started by DRE, Sep 9, 2012.

  1. DRE

    DRE Well-Known Member

    I would like to either remove or alter the avatar for thread preview hover. What template/css can this be altered at?

  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Admin CP -> Appearance -> Templates -> thread_list_item_preview
    8thos likes this.
  3. Shelley

    Shelley Well-Known Member

    If your removing the avatar you'll have to add the following or increase it if your deciding to use "m" sized avatar.

    .previewTooltip .text {
        margin-left: 0;
    Jake Bunce and 8thos like this.
  4. DRE

    DRE Well-Known Member

    Thank you very much Jake and Shelley!
  5. Shelley

    Shelley Well-Known Member

    Are you removing the avatar? if so you can save yourself a template edit and add the following.

    .previewTooltip .text {
        margin-left: 0;
    .previewTooltip .avatar {
    8thos and Jake Bunce like this.
  6. DRE

    DRE Well-Known Member

    Yes I am removing it. http://www.8thos.com/threads/members-only-avatar-feature.2205/

    I made a member's only avatar feature when I was on vB4 but it's different making it for XF because of so many places that the avatar pops up.
  7. Phatcows

    Phatcows Active Member

    Sorry to resurrect an old thread but I have a question along the same line and I don't want to create a duplicate thread.

    We post a lot of pictures in our threads, which are hosted externally. When you hover over the thread title, the preview just contains bb code, ie IMG IMG IMG IMG IMG IMG IMG (in block quotes of course).

    How do I stop this from happening?
    Last edited: Oct 15, 2013
  8. Brogan

    Brogan XenForo Moderator Staff Member

    The placeholders are there deliberately.
    If a post just contains an image and no text the preview would be blank, which would look worse.
  9. Phatcows

    Phatcows Active Member

    Is it possible to turn off thread preview?
  10. Jeremy

    Jeremy Well-Known Member

    Remove the PreviewTooltip class from the template and it should prevent it.
    Phatcows likes this.
  11. Phatcows

    Phatcows Active Member

    Thank you kindly :)
  12. cclaerhout

    cclaerhout Well-Known Member

    There is an option to display the content of the bbcode instead of its tag inside this addon.
  13. Phatcows

    Phatcows Active Member

    I did see that addon when I was looking for an answer prior to posting in this thread but it looked a little overkill for what I required. However in saying that, I will install it on our Beta forum and have a look. Thanks :)
  14. Phatcows

    Phatcows Active Member

    @cclaerhout Okay so that addon is quite nice, it has lots of nice options and is well set out in the options etc. But because we host images externally, it doesn't quite have the effect I was looking for. It's otherwise very neat though.

    @Jeremy Is it possible to edit the PreviewTooltip class to only be deactivated on certain sub forums? We have some threads heavy in pictures (like our photography thread), but also threads that are very wordy (ie General chat).
    The thread preview option is really good for the wordy threads but not good for the (externally hosted) picture threads. Is there a happy medium or am I destined to one or the other?
  15. Jeremy

    Jeremy Well-Known Member

    Surround the display with conditionals.
  16. Phatcows

    Phatcows Active Member

    Super. Thank you for your replies :)
  17. Phatcows

    Phatcows Active Member

    Okay I surrounded the display with conditionals in the PreviewTooltip template, thanks to Brogan's awesome conditional help page and that's all working well. I have but one more question. It doesn't seem to work when you click the 'What's new?' link. I looked at the template code and saw it included <xen:include template="preview_tooltip" /> so I am not sure why it isn't working. My PreviewTooltip template looks like this:

    <xen:if is="in_array({$forum.node_id}, array(8, 10, 142, 12, 66, 14, 137, 193, 200, 40, 160, 41, 161, 54, 207, 56, 208 ))" >

    <xen:else / >

    <div id="PreviewTooltip">
    <span class="arrow"><span></span></span>

    <div class="section">
    <div class="primaryContent previewContent">
    span class="PreviewContents">{xen: phrase loading}...</span>

    (had to add a space between : and p in this post to stop the smiley)


  18. LuciusVorenu

    LuciusVorenu New Member

    Is there a way to disable thread preview hover on certain forum categories, or even better, for defined prefixes?

    On my forum, we have an entertainment section to discuss movies and TV shows, and we have a SPOILER prefix. The problem is that when someone hovers over any thread it shows a preview, which will reveal the spoiler - something I'd like to change.

    So basically a way to ensure that certain threads that I can define or certain prefixes won't show previews when hovering on the link.

    Is this possible?
  19. Valter

    Valter Active Member

    To include thread title in thread preview:

    Add this:
    <div class="posterDate muted" style="border:0px;">{$thread.title}</div>
    <div class="posterDate muted"></div>

    <div class="text">

    It's not really needed in thread list but it's nice in statistics on forum home where titles are trimmed etc...
    Last edited: Feb 5, 2015

Share This Page