Comments (8)
Yes, we could also think about adding this as a feature. Grouping content elements is a common task and should be easy as well. Falling back to TsConfig removes the benefit of having everything in the Content Block. Not sure how this would look like though.
from content-blocks.
This is a feature request that also came up for me recently, while working on the first real-life projects with Content Blocks in use.
Without any thoughts about the implementation yet, my first idea would be that a group is automatically created with the key as the label when it is used in a Content Block for the first time and content elements with this group set in the configuration are checked for a label within a defined schema for the translation key, where either the first or last definition wins?
This would make it possible to define a group in a content block, copy it and it would work out-of-the-box without having to worry about whether other outer requirements are fulfilled for this content element to be fully functional. Hope it's understandable what I want to point out. ;)
Looking forward to any feedback on this approach and please let me know if I can help in any way.
from content-blocks.
While I like the idea to also isolate adding new groups within a Content Block, I feel like this should be defined outside. The reason is that most of the time you maybe add 1 or 2 more groups in addition to the default one. It would be too much redundance even for Content Blocks. Changing the label for a group would be painful.
Idea:
We could add another Folder "Groups" where you can place a yaml file, which contains a list of group ids. Next to it there is a Labels.xlf file with a pre-defined schema like for fields.
ContentBlocks
ContentElements
...
Groups
Groups.yaml
Labels.xlf
Groups.yaml
- group1
- group2
...
Labels.xlf
<trans-unit key="group1.label">
...
<trans-unit key="group2.label">
...
from content-blocks.
What I think about it: A new directory for such a little feature sounds really expensive to me. I stumbled upon it by myself, and so I understand the need. On the other hand, it is really really easy is to do it the "old" way. So I come to the conclusion, it would be nice to have, but if we implement it, we need something smooth. I have something in my mind like:
// EditorInterface.yaml
// if group property is string, just add it to the group
group: common
// but you can register a new group via an "array"
group:
-
newgroup1: "My first group"
-
newGroup2: "LLL:EXT:sitepackage..."
// if label is empty, look in the Labels.xlf for key group.newGroup3:
-
newGroup3
I havenโt thought it through, but maybe this could be an approach...
With an array, you are able to add the content block to multiple groups. (eg. common and interactive)
In normal cases, you should "register" only the groups, in which the content block appears.
One more reason to do it in a content element is IMHO, that this is "content element only" thing.
from content-blocks.
On the other hand, it is really really easy is to do it the "old" way.
Yes, this is true. That's why I hesitated so long to tackle this issue at all.
With an array, you are able to add the content block to multiple groups.
Huh, I didn't thought about that at all. Never seen this someone do, though.
Also, there is the possibility to set default values per Wizard entry. So an element could be registered multiple times in different groups + with different default values.
In addition, you can also set before:group1
and after:group1
in TsConfig.
One more reason to do it in a content element is IMHO, that this is "content element only" thing.
Well, right now this is true. There is a WIP patch right now to unify Wizard groups and TCA type select groups: https://review.typo3.org/c/Packages/TYPO3.CMS/+/73488
With this it would be possible to also group PageTypes and RecordTypes (at least in the TCA type select field).
There are some unresolved issues though.
from content-blocks.
Huh, I didn't thought about that at all. Never seen this someone do, though.
Look at bootstrap_package: you will find e.g. textpic in the groups common, media, and text. For me it make sense, because someone could search it there. (At the newContentElementWizard)
Also, there is the possibility to set default values per Wizard entry. So an element could be registered multiple times in different groups + with different default values.
Didn't know that before. This is crazy and amazing, but what I found out is, the more possibilities editors have in the newContentElementWizard, the more they are confused.
from content-blocks.
In v13 this needs to be called to add a group.
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItemGroup(
'tt_content',
'CType',
'content-blocks-custom',
'My label'
);
from content-blocks.
We talked about it:
We are not planning to support the creation of custom groups. We don't see a benefit doing it in YAML.
- We want to refer in our documentation to the Core documentation. https://docs.typo3.org/m/typo3/reference-tca/main/en-us/ColumnsConfig/Type/Select/Properties/ItemGroups.html#adding-custom-select-item-groups
Internal code:
We'd like to use the new TCA-way https://review.typo3.org/c/Packages/TYPO3.CMS/+/73488 instead of the current TSConfig way for adding our CType to a group.
from content-blocks.
Related Issues (20)
- Category Field in RecordType not working in Translation HOT 6
- Extend page tca with contenblocks pagetype HOT 1
- Undefined TranslationState in IRRE Element HOT 1
- Custom Fields from TCA fail on save HOT 2
- Using existing fields of type group with internal_type folder fails with an exception HOT 5
- Page Type registration breaks language pallete HOT 1
- QUESTION: How to use code blocks withTYPO3 v. 13.2.0? HOT 6
- Content-Blocks interfers with vendor/bin/typo3 Symfony Expression Language handling HOT 4
- Is it possible to access the values of the TYPO3 constants in the template? HOT 3
- [SOLVED] missing required type on T3 V13.2 with CB Branch typo3-v13 HOT 6
- dev mode (DDEV): Dependency Injection HOT 2
- Question to SQL error: "Unknown column in field list" HOT 3
- Allow to define special Page Type icons for root and mountpoint
- Random ideas
- Document that f:cObject now supports RecordInterface
- Question: Pass constants to content blocks HOT 3
- Nested Content Elements gets rendered twice when using standard CE's HOT 3
- Slug not generating correctly HOT 3
- Collection fields with "minitems" defined
- [INTERNAL] Add possibility for ContentBlockRegistry to retrieve ContentBlock by table/recordType
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from content-blocks.