Skip to content

Instantly share code, notes, and snippets.

@cedricziel
Created September 16, 2013 10:39
Show Gist options
  • Save cedricziel/6579070 to your computer and use it in GitHub Desktop.
Save cedricziel/6579070 to your computer and use it in GitHub Desktop.
Define a flexform for your plugin
<?php
//...
/**
* The partners plugin
*/
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'Vendor.' . $_EXTKEY,
'Partners',
array(
'Organisation' => 'list, show, search, listByIndustry, listByService',
),
// non-cacheable actions
array(
'Organisation' => 'search, listByIndustry, listByService',
)
);
<?php
/**
* The partners plugin renders all Organisations
*/
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
$_EXTKEY,
'Partners',
'Vendor: Partners',
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($_EXTKEY) .
'Resources/Public/Icons/Plugins/plugin.partners.gif'
);
//..
/**
* Generate an adequate pluginSignature
*/
$extensionName = \TYPO3\CMS\Core\Utility\GeneralUtility::underscoredToUpperCamelCase($_EXTKEY);
$partnersPluginSignature = strtolower($extensionName) . '_' . strtolower('Partners');
/**
* Register FlexForm for Plugin Partners
*/
$TCA['tt_content']['types']['list']['subtypes_addlist'][$partnersPluginSignature] = 'pi_flexform';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue(
$partnersPluginSignature,
'FILE:EXT:' . $_EXTKEY . '/Configuration/FlexForms/Partners.xml'
);
<T3DataStructure>
<sheets>
<sDEF>
<ROOT>
<TCEforms>
<sheetTitle>Behaviour</sheetTitle>
</TCEforms>
<type>array</type>
<el>
<switchableControllerActions>
<TCEforms>
<label>Display Type</label>
<config>
<type>select</type>
<items>
<numIndex index="0">
<numIndex index="0">Show Search Form</numIndex>
<numIndex index="1">Organisation->list;Organisation->show;Organisation->search</numIndex>
</numIndex>
</items>
</config>
</TCEforms>
</switchableControllerActions>
<settings.partnerFinderPage>
<TCEforms>
<label>Target page for the partner finder</label>
<config>
<type>group</type>
<internal_type>db</internal_type>
<allowed>pages</allowed>
<size>1</size>
<maxitems>1</maxitems>
<minitems>0</minitems>
<show_thumbs>1</show_thumbs>
</config>
</TCEforms>
</settings.partnerFinderPage>
<settings.partnerFinderPageSingle>
<TCEforms>
<label>Target page for the partner finder (Single Partner)</label>
<config>
<type>group</type>
<internal_type>db</internal_type>
<allowed>pages</allowed>
<size>1</size>
<maxitems>1</maxitems>
<minitems>0</minitems>
<show_thumbs>1</show_thumbs>
</config>
</TCEforms>
</settings.partnerFinderPageSingle>
<settings.casestudy.page>
<TCEforms>
<label>Target page for success stories plugin</label>
<config>
<type>group</type>
<internal_type>db</internal_type>
<allowed>pages</allowed>
<size>1</size>
<maxitems>1</maxitems>
<minitems>0</minitems>
<show_thumbs>1</show_thumbs>
</config>
</TCEforms>
</settings.casestudy.page>
<settings.service.page>
<TCEforms>
<label>Target page for the services plugin</label>
<config>
<type>group</type>
<internal_type>db</internal_type>
<allowed>pages</allowed>
<size>1</size>
<maxitems>1</maxitems>
<minitems>0</minitems>
<show_thumbs>1</show_thumbs>
</config>
</TCEforms>
</settings.service.page>
</el>
</ROOT>
</sDEF>
<target>
<ROOT>
<TCEforms>
<sheetTitle>Tag Cloud</sheetTitle>
</TCEforms>
<type>array</type>
<el>
<settings.header>
<TCEforms>
<label>Heading for the Plugin</label>
<config>
<type>input</type>
<eval>trim</eval>
<size>60</size>
<default></default>
</config>
</TCEforms>
</settings.header>
<settings.industryShowPage>
<TCEforms>
<exclude>1</exclude>
<label>Target page for single Industries</label>
<config>
<type>group</type>
<internal_type>db</internal_type>
<allowed>pages</allowed>
<size>1</size>
<maxitems>1</maxitems>
<minitems>0</minitems>
<show_thumbs>1</show_thumbs>
</config>
</TCEforms>
</settings.industryShowPage>
</el>
</ROOT>
</target>
</sheets>
</T3DataStructure>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment