Inside TYPO3

3.9.4. Implementing CSH for your own tables/fields

Implementing CSH for tables and fields of a table is very easy. The display of description, help icon etc. is automatically done by the form rendering class as long as you do the configuration properly. Lets look at two examples:

Adding CSH for fields added to existing tables

Say you have created an extension named "myext" and you have extended the pages-table with a new field, "tx_myext_test". What you need to do is to:

  1. Create a file named something like "locallang_csh_pages.php" in your extension directory. Then enter PHP-code along these lines:

      
    <?php

    /**
    * Default TCA_DESCR for my new field in the "pages" table
    */


    $LOCAL_LANG
    = Array (

    'default'
    => Array (

    'tx_myext_test.description'
    =>
    'Enter some test content'
    ,

    'tx_myext_test.details'
    =>
    'You can enter any content you like in this field'
    ,
    )
    );

    ?>
      
  1. Then add this line to the ext_tables.php file of your extension:

      t3lib_extMgm::addLLrefForTCAdescr('pages','EXT:myext/locallang_csh_pages.php');
    

 

That's it.

To top


Valid XHTML 1.0!