.. ================================================== .. FOR YOUR INFORMATION .. -------------------------------------------------- .. -*- coding: utf-8 -*- with BOM. .. include:: ../Includes.txt .. _users-manual: Developer manual ================ Custom layouts -------------- The registration of layouts requires following data: - Key of the layout (if it already exists, the former layout will be overriden) - Path to a Fluid template - Label (String or LLL) - Icon (optional) Example: :: \FORM4\Form4Teaser\Utility\ConfigurationUtility::addFluidLayout( 'textpic', 'Teaser/Textpic', 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang_db.xlf:settings.layout.items.textpic', FALSE ); Custom sortings --------------- The registration of sortings requires following data: - Key of the sorting (if it already exists, the former sorting will be overriden) - A callable (a anonymous function or a string referencing a function/method) - Label (String or LLL) - Icon (optional) Example: :: \FORM4\Form4Teaser\Utility\ConfigurationUtility::addSorting( 'starttime', array('FORM4\\Form4Teaser\\Utility\\SortingsUtility', 'byStarttime'), 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang_db.xlf:settings.sorting.items.starttime', FALSE ); Two parameters are provided to the callable: - $settings : array - $query : \TYPO3\CMS\Extbase\Persistence\QueryInterface The $settings array should be used as reference (&$settings), so its content can be manipulated. The $query object can be used to create constraints. If the callable returns a constraint or an array of constraint they are added to the query before its execution. **However, we discourage to use these possibilities to implement other stuff than sorting** Example: :: class SortingsUtility { public function byStarttime (&$settings, $query) { $settings['sortingField'] = 'starttime'; } } Custom sorting directions ------------------------- The registration and implementation of sorting directions is the same as of sortings. Example: :: \FORM4\Form4Teaser\Utility\ConfigurationUtility::addSortingDirection( 'ascending', array('FORM4\\Form4Teaser\\Utility\\SortingDirectionsUtility', 'ascending'), 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang_db.xlf:settings.sortingDirection.items.asc', FALSE ); :: class SortingDirectionsUtility { public function ascending (&$settings, $query) { $query->setOrderings(array( $settings['sortingField'] => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_ASCENDING )); } } Signal Slots ------------ .. t3-field-list-table:: :header-rows: 1 - :Class,25: Class Name :Name,10: Signal Name :Description,35: Description :Arguments,30: Arguments - :Class: \\FORM4\\Form4Teaser\\Domain\\Repository\\LargePageRepository :Name: modifyResults :Description: Modify the result after it was fetched from database :Arguments: - \\TYPO3\\CMS\\Extbase\\Persistence\\QueryResultInterface $result - array $settings The plugin settings Further information ------------------- If you want to remove existing layouts, sortings or sorting directions have a look at the API provided by the class \FORM4\Form4Teaser\Utility\ConfigurationUtility.