[TYPO3-mvc] Re: filter and pagination views of own extension really slow

Guido Jansen guido_jansen at gmx.de
Mon Nov 17 15:06:52 CET 2014


I suggest you make a custim paginate template
like described here 
www.npostnik.de/typo3/eigenes-template-im-fluid-pagination-widget/ (German) and here blog.mindscreen.de/2011/fluid-pagebrowser-ubersetzung-und-templating-via-dependency-injection/ (German as well)

[code]
<?php
  namespace Vendor\MyExtName\ViewHelpers\Widget\Controller;
  use \TYPO3\CMS\Core\Utility\GeneralUtility;

class PaginateController extends  \TYPO3\CMS\Fluid\ViewHelpers\Widget\Controller\PaginateController {

  /**
   * @param \TYPO3\CMS\Extbase\MVC\View_ViewInterface $view
   * @return void
   * @todo implement logic for overriding widget template paths (tx_extension.view.widget.<WidgetViewHelperClassName>.templateRootPath...)
   */
  protected function setViewConfiguration(\TYPO3\CMS\Extbase\MVC\View\ViewInterface $view) {
    $extbaseFrameworkConfiguration = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
    $widgetViewHelperClassName = $this->request->getWidgetContext()->getWidgetViewHelperClassName();
    if (isset($extbaseFrameworkConfiguration['view']['widget'][$widgetViewHelperClassName]['templateRootPath'])
        && strlen($extbaseFrameworkConfiguration['view']['widget'][$widgetViewHelperClassName]['templateRootPath']) > 0
        && method_exists($view, 'setTemplateRootPath')) {
      $view->setTemplateRootPath(GeneralUtility::getFileAbsFileName($extbaseFrameworkConfiguration['view']['widget'][$widgetViewHelperClassName]['templateRootPath']));
    }
  }

}
?>
[/code]

[code]
config.tx_extbase {
  objects {
    TYPO3\CMS\Fluid\ViewHelpers\Widget\Controller\PaginateController {
      className = Vendor\MyExtName\ViewHelpers\Widget\Controller\PaginateController
    }
}
[/code]

Copy the template from
typo3/sysext/fluid/Resources/Private/Templates/ViewHelpers/Widget/Paginate/Index.html
to EXT:my_ext_name/Resources/Private/Templates/ViewHelpers/Widget/Paginate/Index.html

You can check for the pages with
[code]
<f:if condition="{f:count(subject:pagination.pages)} > 1">
<!-- only with more than one page -->
</f:if>
[/code]


More information about the TYPO3-project-typo3v4mvc mailing list