How to create flex form in extbase extenstion

If you are working with extbase extension development and you're in such a need that you want to provide customization options available from backend only then you can do it using flex form.

In the flex form you can provide many typos of input options as per your need. Like input text, textarea, rich content, likes etc.

For setting flex form you need to do below configuration in your extension. 


$extensionName = t3lib_div::underscoredToUpperCamelCase($_EXTKEY);
$pluginSignature = strtolower($extensionName) . '_pluginnameinsmalllatters';
(In place of  above red highlighted text, you have to put your name of plugin in small latters. )

$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform';
t3lib_extMgm::addPiFlexFormValue($pluginSignature, 'FILE:EXT:' . $_EXTKEY . '/Configuration/FlexForms/flexform.xml');

(Configuration/FlexForms/flexform.xml is the path to your flex form xml.)



Now, you have to create a folder FlexForms in Configuration folder. Then you have to create flexfom.xml file in FlexForms folder.

For sample flex form, you can use below code :

<t3datastructure>
        <langdisable>1</langdisable>  
  <sheets>
   <sdef>
    <root>
     <tceforms>
      <sheettitle>General Settings</sheettitle>
     </tceforms>
     <type>array</type>
        <el>
                <settings .pageid="">
            <tceforms>
              <exclude>1</exclude>
              <label>Login page</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>
      </el>
     </root>
    </sdef>
   </sheets>
 </t3datastructure>


Now, you have to clear typo3temp folder (You can use the easy script cleartemp) and clear cache from backend.
You will have a link option in your backend once you use above flex form.

You can get the selected values in flex form by using below code :

$this->settings['pageid']

You can also use other flex form fields. Find more on below link :

http://typo3techie.blogspot.in/search/label/FlexForm

Thanks for reading the post. If you like this post then share with your friends. ENJOY !! :)

1 comments:

I really appreciate information shared above. It’s of great help. If someone want to learn Online (Virtual) instructor lead live training in Typo3, kindly contact us http://www.maxmunus.com/contact
MaxMunus Offer World Class Virtual Instructor led training on Typo3. We have industry expert trainer. We provide Training Material and Software Support. MaxMunus has successfully conducted 100000+ trainings in India, USA, UK, Australlia, Switzerland, Qatar, Saudi Arabia, Bangladesh, Bahrain and UAE etc.
For Demo Contact us:
Name : Arunkumar U
Email : arun@maxmunus.com
Skype id: training_maxmunus
Contact No.-+91-9738507310
Company Website –http://www.maxmunus.com


Reply

Post a Comment

Thanks for your comment.