XF 2.1 Widget on page with pages/pagination

Robert9

Well-known member
Is there any addon as an example for me how to extend a normal widget like "New threads" with a pagination and more pages?
Any idea where to start?
 
I have added

'total' => $total,
'perPage' => $perPage,
'page' => $page,

and show now the pagination in my page with

Code:
<xf:pagenav
            page="{$page}" perpage="{$perPage}" total="{{ $total + 1 }}"
            link="pages/test" data="{$thread}"
            wrapperclass="block-outer-main" />

I have now
pages/test?page=1
pages/test?page=2
pages/test?page=3
...

but how can i use ?page in widget/file/render()?

These values come from the widget options

Code:
    public function verifyOptions(\XF\Http\Request $request, array &$options, &$error = null)
    {
        $options = $request->filter([
            'limit' => 'uint',
            'style' => 'str',
            'exclude_node_ids' => 'array-uint',
            'include_node_ids' => 'array-uint',
            'show_expanded_title' => 'bool',
            'date_limit_days' => 'uint',

            'page' => 'uint', 
        ]);

I cant catch page here.

Also i cant use

$page = $this->filterPage();

it is an undefined method in my class.
 
Back
Top Bottom