Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Special URLs for Custom Pagination

Go to End

3 Posts   1490 Views


Community Member, 197 Posts

11 January 2011 at 2:13pm

I now use this URL pattern for my custom pagination:

I would rather use this:

However that URL gives a 404 Not Found error.

How can I get a page ending in /page5/ to be controlled by the appropriate controller?


Community Member, 102 Posts

12 January 2011 at 4:58am

First, you need to tell the controller class for your page that it is allowed to take parameters.

e.g. add this to the contrioller section:

static $allowed_actions = array(

...then you can access the parameters like this...

$action = Director::URLParam('action');
$page = Director::URLParam('ID');
$recsperpage = Director::URLParam('OtherID');

e.g. if you browse to...

...then using the above assignment code

$action is 'page'
$page is 5
$recsperpage is 50


Alternatively, use url handlers:

All this is ripe for a tutorial. I wonder if one exists.


Community Member, 197 Posts

12 January 2011 at 5:56am