流体分页控件的配置



我正在使用流体分页小部件。您可以在流体模板中对其进行配置。

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

有没有办法通过常量设置({settings.xxxxx}(来配置小部件。 这样我就不必为不同的配置使用不同的模板?

尝试这个我得到 - 不足为奇 - 错误:

The argument "configuration" was registered with type "array", but is of type "string" in view helper "TYPO3CMSFluidViewHelpersWidgetPaginateViewHelper"

我将在我的TypoScript设置中这样做,如下所示:

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

现在我可以将完整的配置放在流体视图助手中:

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

您还可以将 TS 设置与常量结合使用以使用常量编辑器,就像其他扩展一样。随心所欲。

最新更新