Advertisement
Mr_media

addNewContentElement

Sep 15th, 2020
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.04 KB | None | 0 0
  1. ##TYPOSCRIPT
  2.  
  3. tt_content {
  4. shufflemix_template_new_my_slider < lib.contentElement
  5. shufflemix_template_new_my_slider {
  6. templateName = MySlider
  7. dataProcessing {
  8. 10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
  9. 10.references.fieldName = assets
  10. }
  11. }
  12. }
  13.  
  14.  
  15. ##PAGETS
  16.  
  17. mod.wizards.newContentElement.wizardItems.common {
  18. elements {
  19. shufflemix_template_new_my_Slider {
  20. iconIdentifier = content-carousel-image
  21. title = My Slider
  22. description = A content element to add one or more images
  23. tt_content_defValues.CType = shufflemix_template_new_my_slider
  24. }
  25. }
  26. show := addToList(shufflemix_template_new_my_slider)
  27. }
  28.  
  29.  
  30. ##tt_content.php
  31.  
  32. <?php
  33. defined('TYPO3_MODE') || die();
  34.  
  35. \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(
  36. array(
  37. 'My slider',
  38. 'shufflemix_template_new_my_slider',
  39. 'EXT:core/Resources/Public/Icons/T3Icons/content/content-carousel-image.svg'
  40. ),
  41. 'CType',
  42. 'shufflemix_template_new'
  43. );
  44.  
  45.  
  46. ##tt_content_my_slider.php
  47.  
  48. \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem(
  49. 'tt_content',
  50. 'CType',
  51. [
  52. 0 => 'My slider',
  53. 1 => 'shufflemix_template_new_my_slider',
  54. 2 => 'shufflemix-template-new-my-slider'
  55. ]
  56. );
  57.  
  58. $GLOBALS['TCA']['tt_content']['types']['shufflemix_template_new_my_slider'] = [
  59. 'showitem' => '
  60. --palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xml:palette.general;general,
  61. --palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xml:palette.header;header,
  62. --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.media,assets,
  63. --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.appearance,
  64. --palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:palette.frames;frames,
  65. --palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:palette.appearanceLinks;appearanceLinks,
  66. --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xml:tabs.access,
  67. --palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xml:palette.visibility;visibility,
  68. --palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xml:palette.access;access,
  69. --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xml:tabs.extended'
  70. ];
  71.  
  72. ##constants_overwrites.txt
  73.  
  74. lib.contentElement {
  75. templateRootPaths.200 = EXT:shufflemix_template_new/Resources/Private/Templates/
  76. partialRootPaths.200 = EXT:shufflemix_template_new/Resources/Private/Partials/
  77. layoutRootPaths.200 = EXT:shufflemix_template_new/Resources/Private/Layout/
  78. }
  79.  
  80.  
  81. ##sys_template.php
  82. // Add an entry in the static template list found in sys_templates for static TS
  83. \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile(
  84. 'shufflemix_template_new',
  85. 'Configuration/TypoScript',
  86. 'My Slider'
  87. );
  88.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement