You are here:  » Jump to last page

Support Forum



Jump to last page

Submitted by chrisst1 on Wed, 2010-12-15 13:56 in

Hi David

Is it possible to add in the ability to jump to the last page of results in the code in navigation.php

Chris

Submitted by support on Wed, 2010-12-15 15:16

Hi,

Sure - towards the end of html/navigation.php, look for the closing DIV line as follows:

    print "</div>";

...and REPLACE that with:

    print "&nbsp;|&nbsp;";
    if ($rewrite)
    {
      $lastHREF = $totalPages.".html";
    }
    else
    {
      $lastHREF = "?q=".urlencode($q)."&amp;page=".$totalPages."&amp;sort=".$sort;
    }
    if ($page <> $totalPages)
    {
      print "<a href='".$lastHREF."'>".translate("Last")."</a>";
    }
    else
    {
      print "<span class='disabled'>".translate("Last")."</span>";
    }
    print "</div>";

That's based on the distribution - I noticed that you were using different CSS classes for enabled / disabled links which you might also want to apply to the above - let me know if you're not sure...

Cheers,
David.
--
PriceTapestry.com

Submitted by chrisst1 on Wed, 2010-12-15 16:51

Thanks David

That worked great, (whispering) had to change:

print "<a href='".$prevHREF."'>".translate("Last")."</a>";

to:

print "<a href='".$lastHREF."'>".translate("Last")."</a>";

in your code above.

Chris

Submitted by support on Wed, 2010-12-15 16:56

Ooops - thanks! Corrected in the original above...

Cheers,
David.
--
PriceTapestry.com