Paging SEO

Topics: Writing modules
Dec 2, 2012 at 5:41 PM

Can i get current page number and count pages for main content zone (or for some zone) from my own module (or part)?

Can i check if page exists list from my own module (or part)?

 

I would like to add seo tags to the lists markup.

For first page only <link rel="next" href="...?page=2" />

For last page only <lin rel="prev" href="...?page=n-1" />

For other page two link above.

Coordinator
Dec 2, 2012 at 10:55 PM

You can do whatever you want from your module. I don't understand the question. There are plenty of paginated contents you can take examples from, such as the blogging module.

Dec 4, 2012 at 9:42 AM
Edited Dec 4, 2012 at 9:45 AM

I would like to add some functionality to the existing paginated list. (add seo tags to it).

From my custom content part which I'm going to add to the content type, i have to know the page number and page count.

I can do like this:

var containerPart = part.ContentItem.As();
if(containerPart != null) {
    // get page number and page count.
    return null;
}

var projectionPart = part.ContentItem.As();
if (projectionPart != null)
{
      // get page number and page count.
      return null;
}

How can I replace comment lines to get the page number and page count.

I would not want to repeat the functionality ContainerPart, ProjectionPart that get page number and page count because they are counted in the corresponding parts and it would be additional load on CMS.

How can i get page number and page count?

Coordinator
Dec 5, 2012 at 7:14 AM

http://weblogs.asp.net/bleroy/archive/2012/03/30/overriding-the-pager-rendering-in-orchard.aspx