Hi,

On 11/03/2016 17:10, TSniper wrote:
Thank you for those informations, what do you recommand for custom fces
(Text+images+custom buttons) ?

As long as there are no areas which can contain other content elements you can easily make your own custom content elements. There are solutions that are technically a lot better, but this way you can migrate FCEs with limited effort.

Some people won't like this method because the data is still stored in flexforms, but it's the easiest solution to use the existing data and still have the FCEs in the backend

- copy in tt_content the contenst of colum tx_templavoila_flex to pi_flexform ; this contains the data of the FCE; set the CType field to the name of the FCE (in this example: 'terslider')

- copy the flexform DS to a file and remove the structures that are specific for TemplaVoilà. This is the flexform that we'll register later for use in tt_content

- in an extension you can configure the content element for the BE in file Configuration/TCA/Overrides/tt_content.php like this example

$GLOBALS['TCA']['tt_content']['columns']['CType']['config']['items'][] = array(

'LLL:EXT:typo3coder/Resources/Private/Language/newContentElements.xlf:extra_terslider_title',
  'terslider',
  'EXT:typo3coder/Resources/Public/Backend/Images/terslider_small.png'
);

No we've added a CType item for a CE 'terslider'.

// flexform for pi_flexform field
$GLOBALS['TCA']['tt_content']['columns']['pi_flexform']['config']['ds'][',terslider'] =
  'FILE:EXT:typo3coder/Configuration/FlexForms/flexform_terslider.xml';

This line registered the flexform file from the previous step for the CType 'terslider'.

$GLOBALS['TCA']['tt_content']['types']['terslider'] = array(
'showitem' => '--palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.general;general,
                                        
section_frame;LLL:EXT:cms/locallang_ttc.xlf:section_frame_formlabel,
                                        pi_flexform; ;,
                                
--div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.access,
--palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.visibility;visibility,
                                        
--palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.access;access,
                                
--div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.extended'
);

This is the hardest part, we determine which fields and tabs must be visible in the BE for this content element: the general tab, access field and the (empty) extended tab. Luckily there is a ton of inspiration in all the content elements from the core itself.

- In this example I'll still use CSS Styled Content, mainly because it's less work for an upgrade project. Otherwise you need to migrate the changes in rendering for use in Fluid Styled Content.
So, we can 'easily' define the rendering in TypoScript:

tt_content.terslider = FLUIDTEMPLATE
tt_content.terslider {
    template = FILE
template.file = EXT:typo3coder/Resources/Private/Templates/ContentELements/Terslider.html
    layoutRootPath = EXT:typo3coder/Resources/Private/Templates/Layout/
    variables {
    }
}

- The next thing we need to do is to make sure that the content element shows up in the New Content Element wizard:

mod {
  wizards.newContentElement.wizardItems.extra {
header = LLL:EXT:typo3coder/Resources/Private/Language/newContentElements.xlf:extra
    elements {
      terslider {
        iconIdentifier = conent-element-terslider
title = LLL:EXT:typo3coder/Resources/Private/Language/newContentElements.xlf:extra_terslider_title description = LLL:EXT:typo3coder/Resources/Private/Language/newContentElements.xlf:extra_terslider_description
        tt_content_defValues {
          CType = terslider
        }
      }
    }
    show = *
  }
}

- The last thing is to make a fluid template for the rendering. You can copy a lot from the old TV mapping. To access the fields in the flexform you need a flexform viewhelper; an example of such a viewhelper is in the extension described in the next paragraph.

You can find all this in the extension "sitepackage" (available in TER). In the documentation of that extension a lot of the configuration is explained. A version specific for TYPO3 7 LTS is in the making.

What can i do for custom extensions, the upgrade process tell me to
uninstall them all before i can go to the next step ? these extensions
are all pi base. Can you tell me how to migrate them with their content ?

Pi_base extensions still work, but need some changes. The class names need to be migrated and some includes have to be removed, but this is generally quite easy to do. The marker based templates can still be used and all the data for these extensions can still be used.

It's quite a bit of work altogether, but once you get the hang of it you'll get faster :-)

--
Jigal van Hemert
TYPO3 CMS Active Contributor

TYPO3 .... inspiring people to share!
Get involved: typo3.org
_______________________________________________
TYPO3-english mailing list
TYPO3-english@lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english

Reply via email to