Coder Social home page Coder Social logo

Comments (5)

IchHabRecht avatar IchHabRecht commented on June 13, 2024

Hi @tlueder,

Would you mind to share an example configuration and use case where the problem is triggered? Thank you very much.

from content_defender.

tlueder avatar tlueder commented on June 13, 2024

Sure mate

Flexform

<T3DataStructure>
  <meta>
    <langDisable>1</langDisable>
  </meta>
  <sheets>
    <main>
      <ROOT>
        <TCEforms>
          <sheetTitle>LLL:EXT:theme/Resources/Private/Language/locallang_db.xlf:general</sheetTitle>
        </TCEforms>
        <type>array</type>
        <el>
          <title>
            <TCEforms>
              <label>LLL:EXT:theme/Resources/Private/Language/locallang_db.xlf:general.title</label>
              <config>
                <type>input</type>
                <size>20</size>
                <max>50</max>
                <eval>trim, required</eval>
              </config>
            </TCEforms>
          </title>
        </el>
      </ROOT>
    </main>
  </sheets>
</T3DataStructure>

TCA override

<?php

declare(strict_types=1);

if (!defined('TYPO3')) {
  exit();
}

$extensionKey = 'theme';

//CE_Button
$GLOBALS['TCA']['tt_content']['types']['CE_Button'] = [
  'showitem' => '
    CType, sys_language_uid, pi_flexform,
    --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.appearance,
      --palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:palette.frames;frames,
      --palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:palette.appearanceLinks;appearanceLinks,
    --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:access,
      --palette--;;hidden,
      --palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:palette.access;access,
  ',
];

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem(
  'tt_content',
  'CType',
  [
    'LLL:EXT:theme/Resources/Private/Language/locallang_db.xlf:ce.button.title',
    'CE_Button',
    'CE_Button',
  ]
);

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue(
  '*',
  'FILE:EXT:'.$extensionKey.'/Configuration/FlexForm/CE_Button.xml',
  'CE_Button'
);

PAGETS

mod.wizards.newContentElement.wizardItems.contentElements {
  header = LLL:EXT:theme/Resources/Private/Language/locallang_db.xlf:ce.tab.title
  elements {
    CE_Button {
      iconIdentifier = CE_Button
      title = LLL:EXT:theme/Resources/Private/Language/locallang_db.xlf:ce.button.title
      description = LLL:EXT:theme/Resources/Private/Language/locallang_db.xlf:ce.button.description
      tt_content_defValues {
        CType = CE_Button
      }
    }
  }

  show := addToList(CE_Button)
}

Typoscript Setup

tt_content.CE_Button =< lib.contentElement
tt_content.CE_Button {
  templateName = CE_Button
  dataProcessing {
    5 = TYPO3\CMS\Frontend\DataProcessing\FlexFormProcessor
    5 {
      fieldName = pi_flexform
      as = flexform
    }
    10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
    10.references {
      fieldName = assets
    }
  }
}

This should be enough I hope.

Just create a new element of this type and save.
I have not tested this when typo3 is in production mode.

Thanks

from content_defender.

IchHabRecht avatar IchHabRecht commented on June 13, 2024

Hi @tlueder,

If I understand your code correctly, you are using a content element that doesn't contain the colPos field at all. How can you add this field to any other column than the default one? I don't expect any content element to hide this field at all as this might break even core functions to be honest.

from content_defender.

tlueder avatar tlueder commented on June 13, 2024

I know,
but that is something the Typo3 Core should deal with.

Or if this field is also mandatory for this ext, this error should be handled other than in this way.

from content_defender.

IchHabRecht avatar IchHabRecht commented on June 13, 2024

@tlueder fine with your comment. Should be handled core wise. So there is no error in content_defender itself.

from content_defender.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.