Post by dony_b » Fri Sep 16, 2011 9:50 pm

Is is possible to add rel "attribute" to the pagination links so if Im on the first page the second link has a rel "next" and on second page the previous links has rel "prev"

I looked into controller/category.php - Is this where I can do this ?

Code: Select all

$pagination = new Pagination();
	$pagination->total = $product_total;
	$pagination->page = $page;
	$pagination->limit = $limit;
	$pagination->text = $this->language->get('text_pagination');
	$pagination->url = $this->url->link('product/category', 'path=' . $this->request->get['path'] . $url . '&page={page}');
	
			$this->data['pagination'] = $pagination->render();

User avatar
Active Member

Posts

Joined
Wed Aug 18, 2010 9:56 pm
Location - Boston, MA

Post by Lisaweb » Tue Feb 21, 2012 9:06 am

I would appreciate an answer to this as well. Anyone?

Using OC v1.5.4.1 with Evisu Theme


User avatar
Active Member

Posts

Joined
Wed Dec 07, 2011 12:01 am

Post by Avvici » Tue Feb 21, 2012 7:20 pm

This actually is already in place with OC's pagination. There already is a < for previous and a > for next with a box around it. You would simply change those to the strings "Next and Previous" :)

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC

Post by Lisaweb » Tue Feb 21, 2012 10:09 pm

Thank you! :-)

Using OC v1.5.4.1 with Evisu Theme


User avatar
Active Member

Posts

Joined
Wed Dec 07, 2011 12:01 am

Post by stonehinged » Fri Apr 20, 2012 12:40 am

dony_b, are you attempting to add the next/prev "rel" attributes to each of the category pages? If so this has to be injected within the <head> tags and I suppose would need to be written as a condition to dynamically determine which page you are on. Sure wish I knew how to do it!

I was reading up a bit on this: http://googlewebmastercentral.blogspot. ... lprev.html

Sounded like this might be what you are after... to indicate the relationship between component URLs in a paginated series.

STONEHINGED
Handcrafted, Semi-Precious Jewelry
http://www.stonehinged.com/


User avatar
Active Member

Posts

Joined
Wed Aug 18, 2010 9:10 am
Location - US

Post by dony_b » Fri Apr 20, 2012 9:58 pm

go to /system/library/pagination.php

Look for this occurrences

Code: Select all

 <a href="' . str_replace('{page}', $i, $this->url) . '">'

User avatar
Active Member

Posts

Joined
Wed Aug 18, 2010 9:56 pm
Location - Boston, MA

Post by stonehinged » Sat Apr 21, 2012 3:08 am

That's what my initial thoughts were but that doesn't encode the <head> tag on each page. What I'm after isn't for anchor tags, but instead page link tags.

The coding would need to render page link tags in the <head> like the following:

On the first page, http://www.example.com/article?story=abc&page=1, you’d include in the <head> section:
<link rel="next" href="http://www.example.com/article?story=abc&page=2" />

On the second page, http://www.example.com/article?story=abc&page=2:
<link rel="prev" href="http://www.example.com/article?story=abc&page=1" />
<link rel="next" href="http://www.example.com/article?story=abc&page=3" />

On the third page, http://www.example.com/article?story=abc&page=3:
<link rel="prev" href="http://www.example.com/article?story=abc&page=2" />
<link rel="next" href="http://www.example.com/article?story=abc&page=4" />

And on the last page, http://www.example.com/article?story=abc&page=4:
<link rel="prev" href="http://www.example.com/article?story=abc&page=3" />

Unfortunately way beyond my skill set!

STONEHINGED
Handcrafted, Semi-Precious Jewelry
http://www.stonehinged.com/


User avatar
Active Member

Posts

Joined
Wed Aug 18, 2010 9:10 am
Location - US

Post by voodoo » Tue May 22, 2012 10:31 am

Hey stonehinged, I just made a mod for this !

http://www.opencart.com/index.php?route ... on_id=6542

New member

Posts

Joined
Thu Apr 15, 2010 10:54 pm

Post by stonehinged » Fri May 25, 2012 4:02 am

Nice! So does it handle all the conditions stated above? And this definitely adds the various link rels within the <head> tag? Sweet if so!

STONEHINGED
Handcrafted, Semi-Precious Jewelry
http://www.stonehinged.com/


User avatar
Active Member

Posts

Joined
Wed Aug 18, 2010 9:10 am
Location - US
Who is online

Users browsing this forum: No registered users and 30 guests