Ben
Ben

Reputation: 1031

Icon size of imageorient selection

I have extended the imageorient selection with some additional options:

TSconfig:

TCEFORM.tt_content.types.textmedia.addItems{
  101 = XL Image
  101.icon = img_xl
  # …
}

The new icons are already registered via the Icon API in a sitepackage.

ext:sitepackage/Configuration/Icons.php

<?php
   return [
        'img_xl' => [
            'provider' => \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
            'source' => 'EXT:sitepackage/Resources/Public/Icons/Content/img_xl.svg',
        ],
        'mybitmapicon' => [
            'provider' => \TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider::class,
            'source' => 'EXT:sitepackage/Resources/Public/Icons/Content/test.png',
        ],
   ];

It looks like this:

enter image description here

They are displayed with 16x16 pixels, no matter how big they actually are (I tried it with svg and png of different sizes). Since some are a bit more complex than the standard icons, I would like to make them larger. Whether the standard icons scale is not important.

Is there any way to influence the output size?

In the TCA Reference it looks like this could be possible, since the example has larger images shown. Probably the TCA would need to be modified via ext:sitepackage/Configuration/TCA/Overrides/tt_content.php, but it's unclear to me how exactly.

Upvotes: 2

Views: 405

Answers (1)

Julian Hofmann
Julian Hofmann

Reputation: 2592

These icons are rendered in SelectIcons::render() (Code) using the FormEngineUtility::getIconHtml()-function (Code).

The rendering depends on the icons declaration:

Icons as file-reference

The Icons are rendered without width/height attributes in HTML. So, it should be possible to use them sized as you want.

Sprite Icons name

The icons are finally rendered by calling IconFactory::createIcon (Code) with a fixed size of 16px (Icon::SIZE_SMALL= 'small' // 16). On a simple way via configuration, another size won't (currently) be possible.

Upvotes: 2

Related Questions