Commit 99f49dcd authored by Sven Burkert's avatar Sven Burkert
Browse files

Compatibility update for TYPO3 10.4, rename TypoScript files, optimize TCA,...

Compatibility update for TYPO3 10.4, rename TypoScript files, optimize TCA, other minor optimizations
parent 968738fa
2021-04-20 Sven Burkert <bedienung@sbtheke.de>
* Compatibility update for TYPO3 10.4 (https://gitlab.com/SBTheke-TYPO3/backgroundimage/-/merge_requests/1, thanks to stigfaerch)
* Rename TypoScript files
* Optimize TCA
* Other minor optimizations
2018-12-17 Sven Burkert <bedienung@sbtheke.de>
* Add composer.json
......@@ -39,4 +45,4 @@
* Small changes in TypoScript and position of upload field in page properties and manual. Please check your TypoScript constants!
20??-??-?? Sven Burkert <bedienung@sbtheke.de>
* Initial release
\ No newline at end of file
* Initial release
......@@ -9,7 +9,7 @@ $newPagesColumns = [
'exclude' => 1,
'l10n_mode' => 'exclude',
'label' => $ll . 'pages.tx_backgroundimage_active',
'requestUpdate' => 1,
'onChange' => 'reload',
'config' => [
'type' => 'check',
],
......@@ -26,6 +26,13 @@ $newPagesColumns = [
'foreign_match_fields' => [
'fieldname' => 'tx_backgroundimage',
],
'overrideChildTca' => [
'types' => [
\TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [
'showitem' => '--palette--;;filePalette'
],
],
],
],
$GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']
),
......@@ -37,6 +44,7 @@ $newPagesColumns = [
'displayCond' => 'FIELD:tx_backgroundimage_active:REQ:true',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'items' => [
[
$ll . 'pages.tx_backgroundimage_default',
......@@ -68,17 +76,9 @@ $newPagesColumns = [
'displayCond' => 'FIELD:tx_backgroundimage_active:REQ:true',
'config' => [
'type' => 'input',
'renderType' => 'colorpicker',
'max' => 20,
'eval' => 'trim',
'wizards' => [
'colorChoice' => [
'type' => 'colorbox',
'module' => [
'name' => 'wizard_colorpicker',
],
'JSopenParams' => 'height=500,width=500,status=0,menubar=0,scrollbars=1',
],
],
],
],
'tx_backgroundimage_position' => [
......@@ -110,6 +110,7 @@ $newPagesColumns = [
'displayCond' => 'FIELD:tx_backgroundimage_active:REQ:true',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'items' => [
[
$ll . 'pages.tx_backgroundimage_default',
......@@ -138,6 +139,3 @@ $newPagesColumns = [
// Create palette
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('pages', '--palette--;LLL:EXT:backgroundimage/Resources/Private/Language/locallang.xlf:pages.palette.backgroundimage;backgroundimage', '', 'after:media');
$GLOBALS['TCA']['pages']['palettes']['backgroundimage']['showitem'] = 'tx_backgroundimage_active, --linebreak--, tx_backgroundimage_image, --linebreak--, tx_backgroundimage_repeat, tx_backgroundimage_color, tx_backgroundimage_position, tx_backgroundimage_size, tx_backgroundimage_attachment';
// Request an update
$GLOBALS['TCA']['pages']['ctrl']['requestUpdate'] .= (empty($GLOBALS['TCA']['pages']['ctrl']['requestUpdate']) === TRUE ? '' : ',') . 'tx_backgroundimage_active';
\ No newline at end of file
<?php
defined('TYPO3_MODE') || die();
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile('backgroundimage', 'Configuration/TypoScript/', 'Background image');
\ No newline at end of file
// Add static template
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile('backgroundimage', 'Configuration/TypoScript/', 'Background image');
plugin.backgroundimage {
slide = 0
target = body
}
\ No newline at end of file
plugin.backgroundimage {
# cat=plugin.tx_backgroundimage//10; type=boolean; label=Slide:Inherit picture from parent pages if you haven't uploaded one for the actual page.
slide = 0
# cat=plugin.tx_backgroundimage//20; type=string; label=CSS selector:Specify where your uploaded image should be shown.
target = body
}
......@@ -12,10 +12,7 @@ page.cssInline.440 {
wrap = background-image:url(/|);
}
references {
table = pages
uid.data = page:uid
fieldName = tx_backgroundimage
#data = levelfield:-1, tx_backgroundimage_image // TODO: write just this line when dropping TYPO3 8.7 support
data = levelfield:-1, tx_backgroundimage_image
}
renderObj = IMG_RESOURCE
renderObj {
......@@ -54,15 +51,14 @@ page.cssInline.440 {
}
}
[{$plugin.backgroundimage.slide} == '1']
page.cssInline.440 {
if.isTrue.data = levelfield:-1, tx_backgroundimage_active, slide
10.references >
10.references.data = levelfield:-1, tx_backgroundimage_image, slide
20.data = levelfield:-1, tx_backgroundimage_repeat, slide
30.data = levelfield:-1, tx_backgroundimage_color, slide
40.data = levelfield:-1, tx_backgroundimage_position, slide
50.data = levelfield:-1, tx_backgroundimage_size, slide
60.data = levelfield:-1, tx_backgroundimage_attachment, slide
}
[end]
\ No newline at end of file
[{$plugin.backgroundimage.slide} == 1]
page.cssInline.440 {
if.isTrue.data = levelfield:-1, tx_backgroundimage_active, slide
10.references.data = levelfield:-1, tx_backgroundimage_image, slide
20.data = levelfield:-1, tx_backgroundimage_repeat, slide
30.data = levelfield:-1, tx_backgroundimage_color, slide
40.data = levelfield:-1, tx_backgroundimage_position, slide
50.data = levelfield:-1, tx_backgroundimage_size, slide
60.data = levelfield:-1, tx_backgroundimage_attachment, slide
}
[end]
......@@ -37,7 +37,6 @@ Overview of TypoScript constants
Property Data type Default Description
========== ========= ========= ===========
slide boolean 0 Inherit picture from parent pages if you haven't uploaded one for the actual page.
**Attention:** Breaks functionality in multilanguage sites (only TYPO3 8.7).
target string body Specify here, where your uploaded image should be shown, for example
**#someId** for a specific id
**.csc-textpic-text** for pagecontent type "Text with image"
......@@ -77,6 +76,13 @@ To-Do list
Write me if you have any suggestions.
--------------------
Usage with TYPO3 8.7
--------------------
Please use version 4.1.0 from TER.
--------------------
Usage with TYPO3 7.6
--------------------
......@@ -102,4 +108,4 @@ Please use version 1.1.2 from TER.
ChangeLog
---------
See file **ChangeLog** in the extension directory.
\ No newline at end of file
See file **ChangeLog** in the extension directory.
{
"name": "sbtheke/backgroundimage",
"license": "GPL-2.0-or-later",
"type": "typo3-cms-extension",
"description": "Enables uploading of an image in page properties, which then is shown on page as background image for a predefined element.",
"homepage": "https://gitlab.com/SBTheke-TYPO3/backgroundimage",
......@@ -11,9 +12,6 @@
"homepage": "https://www.sbtheke.de"
}
],
"license": [
"GPL-2.0+"
],
"support": {
"issues": "https://gitlab.com/SBTheke-TYPO3/backgroundimage/issues"
},
......@@ -25,13 +23,17 @@
"content",
"backgroundimage"
],
"version": "4.1.0",
"require": {
"typo3/cms-core": "^9.5 || ^10.4"
},
"extra": {
"typo3/cms": {
"extension-key": "backgroundimage"
}
},
"autoload": {
"psr-4": {
"SBTheke\\Backgroundimage\\": "Classes"
}
}
}
\ No newline at end of file
}
......@@ -14,7 +14,7 @@ $EM_CONF[$_EXTKEY] = array (
'title' => 'Background Image',
'description' => 'Enables uploading of an image in page properties, which then is shown on page as background image for a predefined element.',
'category' => 'fe',
'version' => '4.1.0',
'version' => '4.2.0',
'state' => 'stable',
'uploadfolder' => false,
'createDirs' => '',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment