Pagination Question

Is there a way to tell what page i am on in pagination? i have a news section and i’m using the meta tags plugin by @pedroborges to set robots meta data in the page head. I want to set this differently on all pages in the pagination, except for the first page.

Basically something like this (i made this up),

c::set('meta-tags.templates', function(Page $page, Site $site) {
    return [
      'news' => [
        'meta' => [
            'robots' => $page->isPageOne()
              ? 'index,follow,noodp'
              : 'noindex,nofollow,noodp',
        ],
      ],
    ];
});

How can i do this in a config file?

You could use the param helper:

param('page')? 'yes':'no';

Smashing. Thank you. This did it:

c::set('meta-tags.templates', function(Page $page, Site $site) {
    return [
      'news' => [
        'meta' => [
              'robots' => function($page) {
                 $pager = param('page') ? 'noindex,nofollow,noodp' : 'index,follow,noodp';
                 return $pager;
              },
        ],
      ],
    ];
});