PDA

View Full Version : How could I add the pagenav buttons to the top of a topic?


GuiltyNL
02-27-2014, 03:56 PM
Our forum members would like to have the page buttons that you can find at the end of a page also on the top of the page. For example next to the 'Subscribe' button.

I was able to use the pagenav template code in the widget_conversationdisplay template. I pasted it at line 253 and that seems to be the right place.

The strange thing is, that the buttons only show up when I first go to another page of the topic. At first they are disappeared.

This is the code of pagenav I used:

<vb:if condition="empty($pagenav)">
{vb:set pagenav.currentpage, 1}
{vb:set pagenav.totalpages, 1}
<vb:elseif condition="isset($pagenav['pagenumber'])" />
{vb:set pagenav.currentpage, {vb:raw pagenav.pagenumber}}
</vb:if>

<div class="pagenav-container noselect{vb:if "$pagenav['totalpages'] == 1", " h-hide"}">
<div class="pagenav h-right">
<vb:if condition="$pagenav['totalpages'] > 1">
{vb:data pages, page, getPageNav, {vb:raw pagenav.currentpage}, {vb:raw pagenav.totalpages}}
</vb:if>
<vb:if condition="$pagenav['currentpage'] != 1">
<a class="button secondary" data-page="{vb:math {vb:var pagenav.currentpage} - 1}">{vb:phrase previous}</a>
</vb:if>
<vb:if condition="!empty($pages)">
<vb:each from="pages" value="page">
<vb:if condition="$pagenav['currentpage'] == $page">
<a class="button primary page" data-page="{vb:raw page}">{vb:raw page}</a>
<vb:else />
<a class="button secondary" data-page="{vb:raw page}">{vb:raw page}</a>
</vb:if>
</vb:each>
</vb:if>
<vb:if condition="$pagenav['currentpage'] != $pagenav['totalpages']">
<a class="button secondary" data-page="{vb:math {vb:var pagenav.currentpage} + 1}">{vb:phrase next}</a>
</vb:if>
</div>
</div>

I see the condition, but I don't understand why this condition does work on the bottom of the page, but not on the top of the page.

Someone any idea?