Yii Framework Forum: Combine pager with sorter CListView - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Combine pager with sorter CListView beautiful url Rate Topic: -----

#1 User is offline   dckurushin 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 392
  • Joined: 16-March 11
  • Location:Israel

Posted 09 September 2011 - 07:10 AM

Hello,
I want to combine pagination and sorting, with nice url...
Don't sure how to do that...

the urls I have now are:
'index/page-<page:\d+>/*' => 'blog/index',	

result:

Quote

mydomain.com/index/page-7.html


Now I want to add sorter

The sorting urls now look very ugly...

for example sorting by title:

Quote

mydomain.com/index/page-4/ajax/yw0/sort/title.html


to remove the ajax/yw0 stuff, I just used in paginator
 'params' => array(),


And this removed the ajax rubbish, but if I add this to the sort the sorter wont see the page number...

and the pager don't see the pagination...
so
 'params' => array(),

is not the way to go...
but I don't want google to index ajax/ywo stuff... I must remove that :blink:

help someone, hope this is not that confusing ;)
0

#2 User is offline   dckurushin 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 392
  • Joined: 16-March 11
  • Location:Israel

Posted 10 September 2011 - 10:06 AM

up, or no one using CListView ?
0

#3 User is offline   tri 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,651
  • Joined: 20-November 08
  • Location:Stockholm, Sweden

Posted 10 September 2011 - 10:27 AM

View Postdckurushin, on 10 September 2011 - 10:06 AM, said:

up, or no one using CListView ?


At least you can get rid of the "yw0" by specifying an id for the widget. Edit: And you can specify your own ajaxVar
  'id'=>'my-listview',
  'ajaxVar'=>'my-ajaxvar',

/Tommy

This post has been edited by tri: 10 September 2011 - 10:51 AM

Don't forget to read The Definitive Guide to Yii (en) (sv) | The class reference has the details
0

#4 User is offline   dckurushin 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 392
  • Joined: 16-March 11
  • Location:Israel

Posted 10 September 2011 - 11:12 AM

View Posttri, on 10 September 2011 - 10:27 AM, said:

At least you can get rid of the "yw0" by specifying an id for the widget. Edit: And you can specify your own ajaxVar
  'id'=>'my-listview',
  'ajaxVar'=>'my-ajaxvar',

/Tommy


Hi Tommy, and if I don't want ajax var at all?

How google will index such stuff? with some added vars? or this is taken in account?
0

#5 User is offline   tri 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,651
  • Joined: 20-November 08
  • Location:Stockholm, Sweden

Posted 10 September 2011 - 11:50 AM

View Postdckurushin, on 10 September 2011 - 11:12 AM, said:

Hi Tommy, and if I don't want ajax var at all?

How google will index such stuff? with some added vars? or this is taken in account?


To the best of my understanding, ajaxVar was introduced because isAjaxRequest (XMLHttpRequest) reportedly wasn't always reliable.

It is used for url creation very near the end of jquery.yiilistview.js. You probably would have to modify something at server side too.

/Tommy
Don't forget to read The Definitive Guide to Yii (en) (sv) | The class reference has the details
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users