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

Add-on Auto dismissing stickies

Discussion in 'Resource and Add-on Requests' started by Stuart Wright, Nov 8, 2013.

  1. Stuart Wright

    Stuart Wright Well-Known Member

    Once stickies have been read by a member, there really is little point in them being in the thread list for that person. Stickies can just clutter up a thread list. I mean look at this for heaven's sake!
    https://support.tapatalk.com/forums/byo-customer-community-support.78/
    12 stickies!

    So how about, as an option when creating a sticky, make it so that when a thread has been read, it will disappear (automatically be dismissed) from the thread list. It's an option because some stickies you might not want to auto dismiss.

    If the thread gets posted to (or edited?), it becomes unread and therefore visible again. That way updates to the stickies are not missed.

    Thanks
     
    Alfa1 likes this.
  2. Brogan

    Brogan XenForo Moderator Staff Member

    You can actually do this very easily with EXTRA.css:
    Code:
    .LoggedIn .discussionListItem.visible.sticky {
    display:none;
    }
    
    .LoggedIn .discussionListItem.visible.sticky.unread {
    display:inline;
    }
    You may want to flesh it out a bit to add a link so people can choose to show hidden threads if they wish.
    Something like:
    Code:
    <xen:if is="{$visitor.user_id}">
        <xen:if is="{$stickyThreads}">
            Stuff here
        </xen:if>
    </xen:if>
    
    The code above won't deal with edits to existing posts however.
    A new post would need to be made to the thread to make it visible again.

    I may do this myself on my site so if I do, I'll post the full instructions later.
     
    MattW and The Forum Heroes like this.
  3. Stuart Wright

    Stuart Wright Well-Known Member

    Awesome, thanks.
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    That was just quickly knocked up in a few seconds.
    It may need testing and tweaking to suit your needs/style.
     
  5. Alfa1

    Alfa1 Well-Known Member

    Very nice idea!
     
  6. Temery

    Temery Active Member

    I placed the following in the extra.css template:

    .LoggedIn .discussionListItem.visible.sticky {
    display:none;
    }

    .LoggedIn .discussionListItem.visible.sticky.unread {
    display:inline;
    }

    <xen:if is="{$visitor.user_id}">
    <xen:if is="{$stickyThreads}">
    Stuff here
    </xen:if>
    </xen:if>


    The stuck threads do disappear once read, but I don't understand what goes in place of, "stuff here" in order to allow the user to unhide a read sticky thread.
     
  7. Brogan

    Brogan XenForo Moderator Staff Member

  8. Temery

    Temery Active Member

    I think I'm all set with step one.

    I added this to the extra.css template, but it doesn't seem to work.
    <xen:if is="!{$visitor.customFields.dismisssticky}">
    .LoggedIn .discussionListItem.visible.sticky {
    display:none;
    }

    .LoggedIn .discussionListItem.visible.sticky.unread {
    display:inline;
    }
    </xen:if>

    I can go to preferences and select the option to hide stickies, but when it is unselected, they don't reappear.

    Am I close?
     
  9. Brogan

    Brogan XenForo Moderator Staff Member

    You can't use that conditional statement in a CSS template.
     

Share This Page