16-Feb-2012, 01:21 PM
Might use of rel='next' and rel='prev' on pagination links help crawlers?
1) Google is recommending rel=next/prev in head to speed up content processing (example ... '<link rel="next" href="/xxxxxxx.php?p=2" />'):
http://googlewebmastercentral.blogspot.c...lprev.html
2) Both rel='next' and rel='prev' are supported in microformats, html4 and html5:
http://microformats.org/wiki/existing-rel-values
http://www.w3.org/TR/html4/types.html#h-6.12
http://www.w3.org/TR/html5/links.html#se...link-types
3) Since Commentics is not able to handle data in head - rel='next' and rel='prev' on pagination links could be helpful, too?
4) I've implemented rel='next' and rel='prev' allready ...
##################################################
function cmtx_paginate ($current_page, $range_of_pages, $total_pages) { //display pagination
global $settings; //globalise settings
if ($current_page > 1) { //if not on page 1
echo " <a rel='start' href='" . htmlentities($_SERVER['PHP_SELF']) . "?p=1" . cmtx_get_query("pagination") . CMTX_ANCHOR_COMMENTS . "' title='" . CMTX_TITLE_PAG_FIRST . "'>" . CMTX_PAGINATION_FIRST . "</a> "; // show link to go back to page 1
$previous_page = $current_page - 1; //get previous page number
echo " <a rel='prev' href='" . htmlentities($_SERVER['PHP_SELF']) . "?p=$previous_page" . cmtx_get_query("pagination") . CMTX_ANCHOR_COMMENTS . "' title='" . CMTX_TITLE_PAG_PREVIOUS . "'>" . CMTX_PAGINATION_PREVIOUS . "</a> "; //show link to go back 1 page
}
for ($x = ($current_page - $range_of_pages); $x < (($current_page + $range_of_pages) + 1); $x++) { //loop to show links to range of pages around current page
if (($x > 0) && ($x <= $total_pages)) { //if it's a valid page number
if ($x == $current_page) { //if we're on current page
echo " $x "; //show it but don't make it a link
} elseif ($x == ($current_page - 1)) {
echo " <a rel='prev' href='" . htmlentities($_SERVER['PHP_SELF']) . "?p=$x" . cmtx_get_query("pagination") . CMTX_ANCHOR_COMMENTS . "' title='$x'>$x</a> "; // for rel='prev'
} elseif ($x == ($current_page + 1)) {
echo " <a rel='next' href='" . htmlentities($_SERVER['PHP_SELF']) . "?p=$x" . cmtx_get_query("pagination") . CMTX_ANCHOR_COMMENTS . "' title='$x'>$x</a> "; // for rel='next'
} else { //if not current page
echo " <a href='" . htmlentities($_SERVER['PHP_SELF']) . "?p=$x" . cmtx_get_query("pagination") . CMTX_ANCHOR_COMMENTS . "' title='$x'>$x</a> "; //make it a link
}
}
}
if ($current_page != $total_pages) { //if not on last page, show forward and last page links
$next_page = $current_page + 1; //get next page
echo " <a rel='next' href='" . htmlentities($_SERVER['PHP_SELF']) . "?p=$next_page" . cmtx_get_query("pagination") . CMTX_ANCHOR_COMMENTS . "' title='" . CMTX_TITLE_PAG_NEXT . "'>" . CMTX_PAGINATION_NEXT . "</a> "; //display forward link for next page
echo " <a href='" . htmlentities($_SERVER['PHP_SELF']) . "?p=$total_pages" . cmtx_get_query("pagination") . CMTX_ANCHOR_COMMENTS . "' title='" . CMTX_TITLE_PAG_LAST . "'>" . CMTX_PAGINATION_LAST . "</a> "; //display forward link for last page
}
} //end of paginate function
1) Google is recommending rel=next/prev in head to speed up content processing (example ... '<link rel="next" href="/xxxxxxx.php?p=2" />'):
http://googlewebmastercentral.blogspot.c...lprev.html
2) Both rel='next' and rel='prev' are supported in microformats, html4 and html5:
http://microformats.org/wiki/existing-rel-values
http://www.w3.org/TR/html4/types.html#h-6.12
http://www.w3.org/TR/html5/links.html#se...link-types
3) Since Commentics is not able to handle data in head - rel='next' and rel='prev' on pagination links could be helpful, too?
4) I've implemented rel='next' and rel='prev' allready ...
##################################################
function cmtx_paginate ($current_page, $range_of_pages, $total_pages) { //display pagination
global $settings; //globalise settings
if ($current_page > 1) { //if not on page 1
echo " <a rel='start' href='" . htmlentities($_SERVER['PHP_SELF']) . "?p=1" . cmtx_get_query("pagination") . CMTX_ANCHOR_COMMENTS . "' title='" . CMTX_TITLE_PAG_FIRST . "'>" . CMTX_PAGINATION_FIRST . "</a> "; // show link to go back to page 1
$previous_page = $current_page - 1; //get previous page number
echo " <a rel='prev' href='" . htmlentities($_SERVER['PHP_SELF']) . "?p=$previous_page" . cmtx_get_query("pagination") . CMTX_ANCHOR_COMMENTS . "' title='" . CMTX_TITLE_PAG_PREVIOUS . "'>" . CMTX_PAGINATION_PREVIOUS . "</a> "; //show link to go back 1 page
}
for ($x = ($current_page - $range_of_pages); $x < (($current_page + $range_of_pages) + 1); $x++) { //loop to show links to range of pages around current page
if (($x > 0) && ($x <= $total_pages)) { //if it's a valid page number
if ($x == $current_page) { //if we're on current page
echo " $x "; //show it but don't make it a link
} elseif ($x == ($current_page - 1)) {
echo " <a rel='prev' href='" . htmlentities($_SERVER['PHP_SELF']) . "?p=$x" . cmtx_get_query("pagination") . CMTX_ANCHOR_COMMENTS . "' title='$x'>$x</a> "; // for rel='prev'
} elseif ($x == ($current_page + 1)) {
echo " <a rel='next' href='" . htmlentities($_SERVER['PHP_SELF']) . "?p=$x" . cmtx_get_query("pagination") . CMTX_ANCHOR_COMMENTS . "' title='$x'>$x</a> "; // for rel='next'
} else { //if not current page
echo " <a href='" . htmlentities($_SERVER['PHP_SELF']) . "?p=$x" . cmtx_get_query("pagination") . CMTX_ANCHOR_COMMENTS . "' title='$x'>$x</a> "; //make it a link
}
}
}
if ($current_page != $total_pages) { //if not on last page, show forward and last page links
$next_page = $current_page + 1; //get next page
echo " <a rel='next' href='" . htmlentities($_SERVER['PHP_SELF']) . "?p=$next_page" . cmtx_get_query("pagination") . CMTX_ANCHOR_COMMENTS . "' title='" . CMTX_TITLE_PAG_NEXT . "'>" . CMTX_PAGINATION_NEXT . "</a> "; //display forward link for next page
echo " <a href='" . htmlentities($_SERVER['PHP_SELF']) . "?p=$total_pages" . cmtx_get_query("pagination") . CMTX_ANCHOR_COMMENTS . "' title='" . CMTX_TITLE_PAG_LAST . "'>" . CMTX_PAGINATION_LAST . "</a> "; //display forward link for last page
}
} //end of paginate function