Merge branch 'master' into develop
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace EP\EpTheme\MetaTag;
|
||||
|
||||
use TYPO3\CMS\Core\Resource\ResourceFactory;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Extbase\Configuration\ConfigurationManager;
|
||||
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
|
||||
use TYPO3\CMS\Extbase\Service\ImageService;
|
||||
|
||||
class OpenGraphMetaTagManager extends \TYPO3\CMS\Seo\MetaTag\OpenGraphMetaTagManager
|
||||
{
|
||||
public function renderAllProperties(): string
|
||||
{
|
||||
if (!array_key_exists('og:image', $this->properties)) {
|
||||
/** @var ConfigurationManager $configurationManager */
|
||||
$configurationManager = GeneralUtility::makeInstance(ConfigurationManager::class);
|
||||
$settings = GeneralUtility::removeDotsFromTS(
|
||||
$configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT)
|
||||
);
|
||||
$imageSource = $settings['plugin']['tx_eptheme']['settings']['ogDefaultImage'];
|
||||
$resourceFactory = ResourceFactory::getInstance();
|
||||
$image = $resourceFactory->getFileObjectFromCombinedIdentifier(sprintf('1:%s', $imageSource));
|
||||
|
||||
if (null !== $image) {
|
||||
/** @var ImageService $imageService */
|
||||
$imageService = GeneralUtility::makeInstance(ImageService::class);
|
||||
$processedImage = $imageService->applyProcessingInstructions($image, ['width' => '1200']);
|
||||
|
||||
$this->addProperty(
|
||||
'og:image',
|
||||
$imageService->getImageUri($processedImage, true),
|
||||
[
|
||||
'url' => $imageService->getImageUri($processedImage, true),
|
||||
'width' => $processedImage->getProperty('width'),
|
||||
'height' => $processedImage->getProperty('height'),
|
||||
'type' => $processedImage->getMimeType(),
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return parent::renderAllProperties();
|
||||
}
|
||||
}
|
||||
@@ -90,6 +90,8 @@ plugin.tx_eptheme {
|
||||
facebookViewContentProductUid =
|
||||
# cat=eptheme/100/150; type=string; label=Facebook ViewContent 'name internal'
|
||||
facebookViewContentNameInternal =
|
||||
# cat=eptheme/100/160; type=string; label=OG default image
|
||||
ogDefaultImage = user_upload/Open_Graph__Linkvorschau_/Home-Vorschaubild.jpg
|
||||
|
||||
# cat=eptheme; type=string; label=Slider storage PID
|
||||
sliderStoragePid =
|
||||
|
||||
@@ -94,6 +94,7 @@ plugin.tx_eptheme {
|
||||
productUid = {$plugin.tx_eptheme.settings.facebookViewContentProductUid}
|
||||
nameInternal = {$plugin.tx_eptheme.settings.facebookViewContentNameInternal}
|
||||
}
|
||||
ogDefaultImage = {$plugin.tx_eptheme.settings.ogDefaultImage}
|
||||
domainsToTrack = bpn.ep-reisen.de,www.ski-boarderweek.de,www.ski-wochenenden.de,www.snowzone.net,www.unichamp.de
|
||||
}
|
||||
view {
|
||||
|
||||
@@ -14,6 +14,12 @@ $GLOBALS['TYPO3_CONF_VARS']['FE']['addRootLineFields'] = 'tx_eptheme_slides';
|
||||
$GLOBALS['TYPO3_CONF_VARS']['RTE']['Presets']['default'] = 'EXT:ep_theme/Configuration/RTE/Default.yaml';
|
||||
$GLOBALS['TYPO3_CONF_VARS']['RTE']['Presets']['ep-reisen'] = 'EXT:ep_theme/Configuration/RTE/Default.yaml';
|
||||
|
||||
$metaTagManagerRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\MetaTag\MetaTagManagerRegistry::class);
|
||||
$metaTagManagerRegistry->registerManager(
|
||||
'ep_opengraph',
|
||||
\EP\EpTheme\MetaTag\OpenGraphMetaTagManager::class
|
||||
);
|
||||
|
||||
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
|
||||
'EP.EpTheme',
|
||||
'SimpleForm',
|
||||
|
||||
Reference in New Issue
Block a user