Created
June 16, 2014 09:49
-
-
Save sebastiansommer/2e3045ec9b90d072b96d to your computer and use it in GitHub Desktop.
Extends the image node type to use the original image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{namespace neos=TYPO3\Neos\ViewHelpers} | |
{namespace media=TYPO3\Media\ViewHelpers} | |
<figure{f:if(condition: imageClassName, then: ' class="{imageClassName}"')}> | |
<f:if condition="{image}"> | |
<f:then> | |
<f:if condition="{link}"> | |
<f:then> | |
<a href="{link}"><media:image asset="{image}" alt="{alternativeText}" title="{title}" maximumWidth="{maximumWidth}" maximumHeight="{maximumHeight}" allowCropping="{allowCropping | |
}" allowUpScaling="{allowUpScaling}" /></a> | |
</f:then> | |
<f:else> | |
<f:if condition="{useOrginal}"> | |
<f:then> | |
<media:image asset="{image.originalImage}" alt="{alternativeText}" title="{title}" maximumWidth="{maximumWidth}" maximumHeight="{maximumHeight}" allowCropping="{allowCropping | |
}" allowUpScaling="{allowUpScaling}" /> | |
</f:then> | |
<f:else> | |
<media:image asset="{image}" alt="{alternativeText}" title="{title}" maximumWidth="{maximumWidth}" maximumHeight="{maximumHeight}" allowCropping="{allowCropping | |
}" allowUpScaling="{allowUpScaling}" /> | |
</f:else> | |
</f:if> | |
</f:else> | |
</f:if> | |
</f:then> | |
<f:else> | |
<f:security.ifAccess resource="TYPO3_Neos_Backend_GeneralAccess"> | |
<f:if condition="{node.context.workspace.name} != 'live'"> | |
<img src="{f:uri.resource(package: 'TYPO3.Neos', path: 'Images/dummy-image.png')}" title="Dummy image" alt="Dummy image" class="neos-handle" /> | |
</f:if> | |
</f:security.ifAccess> | |
</f:else> | |
</f:if> | |
<f:if condition="{hasCaption}"> | |
<figcaption> | |
{neos:contentElement.editable(property: 'caption', node: node)} | |
</figcaption> | |
</f:if> | |
</figure> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
prototype(TYPO3.Neos.NodeTypes:Image) { | |
templatePath = 'resource://Fancy.Packge/Private/Templates/NodeTypes/Partials/Image.html' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'TYPO3.Neos.NodeTypes:Image': | |
properties: | |
useOrginal: | |
type: boolean | |
ui: | |
label: 'Use orginal image' | |
reloadIfChanged: TRUE | |
inspector: | |
group: 'image' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment