CGridView - can I make sorting and pagination links ajax-only?

Hi All,

I was wondering if it’s possible to make sorting and pagination links ajax-only? I need it to make sure search engines won’t crawl and index all these links.


Sorry for bumping this up… Need it very much.

I don’t know if there is a standard way (you can always write your own CSort and CPagination).

I think that there is nothing to be afraid of: the link of pagination and sort are generated using the query string (?sort=field&page=1) and never path (/sort/field/page/1).

In this case, search engine will understand that are many pages of a main content, and will not count them as different pages.

Thanks zaccaria,

Will write my own classes.

Yes, Google will most likely figure this out, but to do this, it will generate lots of bandwidth, as I have quite many pages with the grid with many columns in them…

My advice is not to be afraid, and leave as it is.

This approach is lazyness-compliant and SEO friendly. If you will make ajax-only the link, Google will not crawl and index all the pages but the first, so your site will not be found for any content but the one that lies in the first pages.

Been lazy sometime is a value, don’t spoil your laziness with excess of working will!! :D

Thank you for your advice. I would certainly do this if I had only few columns. But on every page I have 3-4 grids each having 4-5 columns. I’ll lose a lot of traffic until Google finally found all links point to the same page… Less evil would be disabling sorting…

Tried to overwrite method createLink of class CSort, but without much success.

Did anybody tried to do this or has any idea on how to do this?