getPreviewMedia example

'@Storefront' => [],
            $basePath . '/Resources/app/storefront/dist/js/main.js' => [],
        ]$config->getScriptFiles());
        static::assertEquals([
            '@Storefront',
            '@Plugins',
            '@SwagTheme',
        ]$config->getViewInheritance());
        static::assertEquals([
            $basePath . '/Resources/app/storefront/dist/assets',
        ]$config->getAssetPaths());
        static::assertEquals($basePath . '/Resources/app/storefront/dist/assets/preview.jpg', $config->getPreviewMedia());
        static::assertEquals([
            'fields' => [
                'sw-image' => [
                    'type' => 'media',
                    'value' => 'app/storefront/dist/assets/test.jpg',
                ],
            ],
        ]$config->getThemeConfig());
        static::assertEquals([
            'custom-icons' => 'app/storefront/src/assets/icon-pack/custom-icons',
        ]$config->getIconSets());
    }
$installedConfiguration = null;
        if ($theme && \is_array($theme->getThemeJson()) && $this->pluginConfigurationFactory) {
            $installedConfiguration = $this->pluginConfigurationFactory->createFromThemeJson(
                $theme->getTechnicalName() ?? 'childTheme',
                $theme->getThemeJson(),
                $pluginConfiguration->getBasePath(),
                false
            );
        }

        if (
            $pluginConfiguration->getPreviewMedia()
            && $pluginConfiguration->getPreviewMedia() !== $installedConfiguration?->getPreviewMedia()
            && (
                $theme === null
                || $theme->getPreviewMedia() === null
                || basename($installedConfiguration?->getPreviewMedia() ?? '') !== $theme->getPreviewMedia()->getFileNameIncludingExtension()
            )
        ) {
            $mediaId = Uuid::randomHex();

            $path = $pluginConfiguration->getPreviewMedia();

            
Home | Imprint | This part of the site doesn't use cookies.