Add images to website
Allow to add images as content within blog posts.
This commit is contained in:
parent
3b4f18b8c4
commit
ca3f397104
7 changed files with 88 additions and 2 deletions
|
@ -1,6 +1,15 @@
|
||||||
mod.wizards.newContentElement.wizardItems {
|
mod.wizards.newContentElement.wizardItems {
|
||||||
common {
|
common {
|
||||||
show = text
|
show = text, image
|
||||||
|
|
||||||
|
elements {
|
||||||
|
image {
|
||||||
|
tt_content_defValues {
|
||||||
|
header = Image
|
||||||
|
header_layout = 100
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
menu {
|
menu {
|
||||||
show = menu_abstract
|
show = menu_abstract
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
TCEFORM.sys_file_reference {
|
||||||
|
link {
|
||||||
|
disabled = 1
|
||||||
|
}
|
||||||
|
crop {
|
||||||
|
disabled = 1
|
||||||
|
}
|
||||||
|
}
|
29
Configuration/TCA/Overrides/tt_content_image.php
Normal file
29
Configuration/TCA/Overrides/tt_content_image.php
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
(function (string $extensionKey, string $table, string $ctype) {
|
||||||
|
\TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($GLOBALS['TCA'][$table], [
|
||||||
|
'types' => [
|
||||||
|
$ctype => [
|
||||||
|
'showitem' => implode(',', [
|
||||||
|
'--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general',
|
||||||
|
'--palette--;;general',
|
||||||
|
'--palette--;;headers',
|
||||||
|
'image',
|
||||||
|
'--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.appearance',
|
||||||
|
'--palette--;;frames',
|
||||||
|
'--palette--;;appearanceLinks',
|
||||||
|
'--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:language',
|
||||||
|
'--palette--;;language',
|
||||||
|
'--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:access',
|
||||||
|
'--palette--;;hidden',
|
||||||
|
'--palette--;;access',
|
||||||
|
'--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:categories',
|
||||||
|
'categories',
|
||||||
|
'--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:notes',
|
||||||
|
'rowDescription',
|
||||||
|
'--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:extended',
|
||||||
|
]),
|
||||||
|
],
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
})('ds_site', 'tt_content', 'image');
|
|
@ -0,0 +1,16 @@
|
||||||
|
tt_content.image =< lib.contentElement
|
||||||
|
tt_content.image {
|
||||||
|
templateName = Image
|
||||||
|
|
||||||
|
dataProcessing {
|
||||||
|
10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
|
||||||
|
10 {
|
||||||
|
references.fieldName = image
|
||||||
|
as = images
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stdWrap {
|
||||||
|
editIcons := appendString(image)
|
||||||
|
}
|
||||||
|
}
|
|
@ -9,6 +9,16 @@ h1, h2, h3, h4, h5, h6 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
figure {
|
||||||
|
text-align: center;
|
||||||
|
padding: $spacer;
|
||||||
|
|
||||||
|
figcaption {
|
||||||
|
text-align: start;
|
||||||
|
padding-top: $spacer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
section > header {
|
section > header {
|
||||||
font-size: 1.5em;
|
font-size: 1.5em;
|
||||||
padding-bottom: $spacer * 2;
|
padding-bottom: $spacer * 2;
|
||||||
|
|
14
Resources/Private/Templates/ContentElements/Image.html
Normal file
14
Resources/Private/Templates/ContentElements/Image.html
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
<html xmlns:f="http://typo3.org/ns/TYPO3/Fluid/ViewHelpers"
|
||||||
|
data-namespace-typo3-fluid="true">
|
||||||
|
|
||||||
|
{f:layout(name: 'Default')}
|
||||||
|
|
||||||
|
<f:section name="Content">
|
||||||
|
<f:for each="{images}" as="image">
|
||||||
|
<figure>
|
||||||
|
<f:image image="{image}" maxWidth="1030" />
|
||||||
|
<figcaption>Figure i{image.originalFile.uid}: {image.description}</figcaption>
|
||||||
|
</figure>
|
||||||
|
</f:for>
|
||||||
|
</f:section>
|
||||||
|
</html>
|
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue