This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

Comments/Pagination - use rel='next', rel='prev' on links?
#1

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


Reply
#2

Thanks stariocek, I'll add this to the next version.

Have you completed the interview?
Reply
#3

Thank you!

This might stop 'blinking' of Rich Snippets (***for page, other, then comments are on***) on google when new comments are added. I hope, that rel='prev/next' in combination with 'permalink' and rel='self bookmark' in Agregate_Review will do it.

Rich Snippets are working without problems for pages wih Commentics on!

( Code of microformats agregate review is on page, other then comments are on:

########### html of microformats ############
...
<span class='permalink'>
<a rel='self bookmark' ' href='/xxxxxxxx.php?p=1'>Link to comments 1st page</a>
</span>
...
########### html of microformats ############
)
Reply
#4

What do you think of adding rel='first' and rel='last' as well?

http://blog.whatwg.org/the-road-to-html-...#rel-first

Have you completed the interview?
Reply
#5

Yes, good:

1. it is HTML5
2. it might help to strenghten connection between index.html alias 1st page with separate stars feed and comments page (it might ... who knows ... only Google does, we are just trying and experimenting ...)

lp, stariocek
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by Steven
01-Sep-2011, 09:52 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)