XF 1.2 Is possible to always show thread page number 1 for multi-paged threads on thread list

maxicep

Active member
Hello

If the thread have many page, then thread pagination shows only the last 3 page number as u know. But i want the show page number 1 for click & go the first page and first post of thread .

I know if there are no new post the thread, thread link will redirect to first page and first post already but watching threads redirecting to first unread post if have new posts in thread.

So, can i add the page number "1" to pagination system if total page number > 3 or add the "go to first post link or icon" in thread_list?

Thank you
 
upload_2013-10-21_9-14-15.webp

Like this?


It's a simple template edit.

Find the template thread_list_item and search for and add the code in red:

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

You may also want to do a similar change to conversation_list_item.

It's worth noting, however, that if you click the date, that does take you to the first post in the thread.
 
Thank you, its working
I applied to conversion list too

But if thread have 2 page, then it looking like:

1-2page.webp

I think, page number 1 must be show only if total page >= 3
 
I've done something a bit different.

If you only show page number 1 when the total pages is above 3, it means if there are two pages, you still don't see the first number. So the solution is actually to show/hide the "..." based on the number of pages:

Code:
                    <xen:if is="{$showLastPageNumbers} AND {$thread.lastPageNumbers}">
                        <span class="itemPageNav">
                            <a href="{xen:link threads, $thread}">1</a>
                            <xen:if is="{xen:count $thread.lastPageNumbers} >= 3 AND {$thread.lastPageNumbers.0} != 2">
                                <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>

That produces:

upload_2013-10-21_9-47-57.webp

Or:

upload_2013-10-21_9-50-26.webp

Or:

upload_2013-10-21_9-48-36.webp

So if there are 3 ore more last page numbers, and the first of those isn't page 2, then show the ellipsis.
 
Almost the same code. I haven't looked at the conversation code. I'm guessing it's just a case of being the same code but "thread" becomes "conversation".
 
Back
Top Bottom