News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Hide the "Pages: [1]" if there is only one

Started by dannbass, April 15, 2016, 02:48:48 AM

Previous topic - Next topic

dannbass

Is there a way to remove the Pages: [1] and have it appear once the board/topic reaches the second page? I asked this some years ago and now I'm want to use again.


Thank you in advance!

Shambles

Sure there is. Are you using 2.0.11 and are you comfortable editing files?

dannbass


Shambles

Ok, you need to edit your Themes/default/Display.template.php file in two places:

Code (Find) Select
// Show the page index... "Pages: [1]".
echo '
<div class="pagesection">
<div class="nextlinks">', $context['previous_next'], '</div>', template_button_strip($normal_buttons, 'right'), '
<div class="pagelinks floatleft">', $txt['pages'], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' &nbsp;&nbsp;<a href="#lastPost"><strong>' . $txt['go_down'] . '</strong></a>' : '', '</div>
</div>';


Code (Replace) Select
// Show the page index... "Pages: [1]".
$showPageInfo = strip_tags($context['page_index']) != '[1] ';
echo '
<div class="pagesection">
<div class="nextlinks">', $context['previous_next'], '</div>', template_button_strip($normal_buttons, 'right'), '
<div class="pagelinks floatleft">', $showPageInfo ? ($txt['pages'] . ': ' . $context['page_index']) : '', !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' &nbsp;&nbsp;<a href="#lastPost"><strong>' . ($showPageInfo ? $txt['go_down'] : '') . '</strong></a>' : '', '</div>
</div>';



then

Code (Find) Select
// Show the page index... "Pages: [1]".
echo '
<div class="pagesection">
', template_button_strip($normal_buttons, 'right'), '
<div class="pagelinks floatleft">', $txt['pages'], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' &nbsp;&nbsp;<a href="#top"><strong>' . $txt['go_up'] . '</strong></a>' : '', '</div>
<div class="nextlinks_bottom">', $context['previous_next'], '</div>
</div>';


Code (Replace) Select
// Show the page index... "Pages: [1]".
echo '
<div class="pagesection">
', template_button_strip($normal_buttons, 'right'), '
<div class="pagelinks floatleft">', $showPageInfo ? ($txt['pages'] . ': ' . $context['page_index']) : '', !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' &nbsp;&nbsp;<a href="#top"><strong>' . ($showPageInfo ? $txt['go_up'] : '') . '</strong></a>' : '', '</div>
<div class="nextlinks_bottom">', $context['previous_next'], '</div>
</div>';

dannbass


Advertisement: