Robert
Robert

Reputation: 592

configuration of Fluid Pagination Widget

I'm using the fluid pagination widget. You can configure it within the fluid template.

<f:widget.paginate objects="{files}" as="paginatedfiles" configuration="{itemsPerPage: 3, insertAbove: 1, insertBelow: 1, maximumNumberOfLinks: 10}">

Is there any way to configure the widget by constant settings ({settings.xxxxx}). so that I don't have to use different templates for different configurations?

Trying this it I get - not surprising - the error:

The argument "configuration" was registered with type "array", but is of type "string" in view helper "TYPO3\CMS\Fluid\ViewHelpers\Widget\PaginateViewHelper"

Upvotes: 0

Views: 1089

Answers (1)

HR123
HR123

Reputation: 708

I'll do it in my TypoScript Setup like this:

plugin.tx_myext {
   settings
       pagebrowser {
           itemsPerPage         = 3
           insertAbove          = 1
           insertBelow          = 1
           maximumNumberOfLinks = 10
       }
   }
}

And now i can put the complete configuration inside the fluid viewhelper:

<f:widget.paginate objects="{files}" as="paginatedfiles" configuration="{settings.pagebrowser}">

You can also combine your TS Setup with Constants to use the constant editor, like other extensions. Whatever you want.

Upvotes: 3

Related Questions