PHP code example of itplusx / flexible-pages

1. Go to this page and download the library: Download itplusx/flexible-pages library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

itplusx / flexible-pages example snippets


\ITplusX\FlexiblePages\Registry\PageTypesRegistration::registerPageType(
  87
  'My Custom pageType',
  [
    \ITplusX\FlexiblePages\Configuration\IconSetConfiguration::ICON_TYPE_DEFAULT => [
        'source' => 'EXT:your_ext/Resources/Public/Icons/apps-pagetree-mycustompagetype.svg',
    ],
    \ITplusX\FlexiblePages\Configuration\IconSetConfiguration::ICON_TYPE_HIDE_IN_MENU => [
        'identifier' => 'apps-pagetree-page-frontend-user-hideinmenu',
    ]
    \ITplusX\FlexiblePages\Configuration\IconSetConfiguration::ICON_TYPE_ROOT_PAGE => [
        'source' => 'EXT:your_ext/Resources/Public/Icons/apps-pagetree-mycustompagetype-root.svg',
    ]
  ],
  'isDraggableInNewPageDragArea' => true
);

$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['flexible_pages']['tx_flexiblepages_pagelist']['templates'] = [
    'myTemplate' => 'My new template',
    'myTemplate2' => 'My new template 2',
];

$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['flexible_pages']['tx_flexiblepages_pagelist']['templates'] = [
    'My new template', 'My new template 2'
];

$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['flexible_pages']['tx_flexiblepages_pagelist']['orderBy'] = [
    'type' => 'Type'
];