SvgTree / SelectTreeElement - Various issues / improvement possibilities
- selectable option for DatabaseTreeNode is currently ignored because \TYPO3\CMS\Backend\Tree\Renderer\ExtJsJsonTreeRenderer::getNodeArray (or corresponding 9.x class) doesn't unset the checked array entry but sets it to false instead.
- SelectTreeElement always sets data-tree-expand-up-to-level which results in expanded setting of a node to be ignored. So either provide an option to not set this option at all or let node.expanded not be ignored otherwise.
- SVGs with SvgIconProvider and a viewBox that exceeds 16x16 width are not scaled down in the tree but displayed as defined by the viewBox which can be way too huge. Workaround is to use BitmapIconProvider but that isn't perfect.
- Tree Element doesn't render field wizards at all currently, even if one were to manually add them.
- ExtJsJsonTreeRenderer does not set expanded setting for node, even if one were to specify it in DatabaseTreeNode.
- Tree is missing field wizards like otherLanguageContent, if not manually added.
- Various options like selectable / expandable are only available for DatabaseNode. However, if I create an own TreeProvider that is not related to the Database those settings would still make sense to be available.
- Overriding the dataProvider for trees also sets internal_type = 'db' if it isn't specified which it shouldn't be for a tree of type "select".
The only soltuion was to manually set "internal_type" to an empty string to avoid setting lookup fields etc. for my non-database tree provider.
- Due to renderType checks the TcaSelectItems DataProvider will be executed if one uses a own renderType for the tree
- If a set dataProvider provides various options for the tree, they will be ignored when finding out the currently set values which means one has to provide an itemsProcFunc or items array additionally, if it isn't a Database based tree.
- TcaSelectTreeDataProvider executes processSelectFieldValue and processDatabaseFieldValue before itemsProcFunc is executed and therefore removing values even with itemsProcFunc supplying the values. Also getStaticValues is never executed.
#3 Updated by Andreas Allacher over 1 year ago
Any SVG can contain a "custom" viewBox that is not "0 0 16 16" and is valid. Actually all viewBox values are custom defined for that graphic.
The easiest "workaround" is to use the BitmapIconProvider because this might not be for just one icon. Might not be perfect but it works without going through all icons and change the viewBox accordingly.
But it is a solution where the icons will be useable as inline SVG for the tree.
However, it should instead be scaled accordingly by TYPO3 / CSS.
Furthermore, the icon doesn't even have to be 1:1 aspect ratio, it can even contain one with a 4:3 aspect ratio and it should still not exceed the height / width of the icon for the tree.