Add images to website

Allow to add images as content within blog posts.
This commit is contained in:
Daniel Siepmann 2019-11-28 18:04:08 +01:00
parent 3b4f18b8c4
commit ca3f397104
7 changed files with 88 additions and 2 deletions

View file

@ -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

View file

@ -0,0 +1,8 @@
TCEFORM.sys_file_reference {
link {
disabled = 1
}
crop {
disabled = 1
}
}

View 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');

View file

@ -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)
}
}

View file

@ -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;

View 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