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

XF 1.4 Annoying thread_list_item behavior

Discussion in 'Styling and Customization Questions' started by sudrien, Nov 4, 2014.

  1. sudrien

    sudrien Member

    This is user reported, but I have to agree.

    It's starting to bug me that a thread that has five pages of comments will have direct links to all but the second page of comments.​

    As far as I can tell by code, this has to do with a combination of $thread.lastPageNumbers and an apparently do-nothing ellipsis in the thread_list_item template.

    Code:
    <xen:if is="{$showLastPageNumbers} AND {$thread.lastPageNumbers}">
       <span class="itemPageNav">
         <span>...</span>
         <xen:foreach loop="$thread.lastPageNumbers" value="$pageNumber">
           <a href="{xen:link threads, $thread, 'page={$pageNumber}'}">{$pageNumber}</a>
         </xen:foreach>
       </span>
    </xen:if>
    

    The ellipsis - which really should be U+2026 - is shown if pages are skipped or not. I'm sure hiding the ellipsis in certain contexts would be the better behavior, but what contexts I'm not sure of.
     
    Last edited: Nov 5, 2014
  2. dieketzer

    dieketzer Well-Known Member

  3. sudrien

    sudrien Member

    It can be seen on the thread list. The links show up when hovering over the row.
     
    Last edited: Nov 4, 2014
    dieketzer likes this.
  4. Brogan

    Brogan XenForo Moderator Staff Member

    It shows the last three pages by default.
     
  5. sudrien

    sudrien Member

    It shows the last three pages, but not page 1, because that would be a redundant link. That part's fine.

    But using an ellipsis implies something has been skipped.

    1 page thread, no links
    2 page thread, nothing skipped but has an ellipsis
    3 page thread, nothing skipped but has an ellipsis
    4 page thread, nothing skipped but has an ellipsis
    5 page thread, page 2 is skipped, elipsis takes up as much room as the link would have
    6+ page thread, ellipsis makes sense.

    It's a grammatically strict nitpick, but nothing that hasn't come up in other contexts.
     
  6. Brogan

    Brogan XenForo Moderator Staff Member

    If it bothers you, you can wrap the ellipsis span in a conditional statement to only show if there are more than x pages.
     
  7. sudrien

    sudrien Member

    Thanks, Brogan, I did some research and have done just that. Here it is for anyone that may care:

    Code:
    <xen:if is="{$showLastPageNumbers} AND {$thread.lastPageNumbers}">
       <span class="itemPageNav">
         <xen:if is="{$thread.lastPageNumbers.0} == 3">
           <a href="{xen:link threads, $thread, 'page=2'}">2</a>
         </xen:if>
         <xen:if is="{$thread.lastPageNumbers.0} >= 4">
           <span>…</span>
         </xen:if>
         <xen:foreach loop="$thread.lastPageNumbers" value="$pageNumber">
           <a href="{xen:link threads, $thread, 'page={$pageNumber}'}">{$pageNumber}</a>
         </xen:foreach>
       </span>
    </xen:if>
    
     

Share This Page