Last active
September 7, 2018 21:21
-
-
Save aertmann/f9c8a33e8720f7cb21be to your computer and use it in GitHub Desktop.
Inline editable properties for a document node (two different approaches) – TYPO3 Neos
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
<neos:contentElement.wrap node="{node}"> | |
<header> | |
<neos:contentElement.editable property="title" tag="h1" /> | |
</header> | |
</neos:contentElement.wrap> |
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
page.body { | |
title = ${q(node).property('title')} | |
} |
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
page.body { | |
header = TYPO3.Neos:Content { | |
templatePath = 'resource://TYPO3.NeosDemoTypo3Org/Private/Templates/Page/Default.html' | |
sectionName = 'header' | |
node = ${node} | |
title = ${q(node).property('title')} | |
} | |
} |
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
<f:section name="body"> | |
{header -> f:format.raw()} | |
</f:section> |
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
<f:section name="header"> | |
<header> | |
<neos:contentElement.editable property="title" tag="h1" /> | |
</header> | |
</f:section> |
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:Page': | |
properties: | |
title: | |
ui: | |
inlineEditable: TRUE | |
inspector: | |
group: ~ | |
aloha: | |
'format': | |
'b': TRUE | |
'i': TRUE | |
'u': TRUE | |
'sub': TRUE | |
'sup': TRUE | |
'p': FALSE | |
'h1': FALSE | |
'h2': FALSE | |
'h3': FALSE | |
'pre': FALSE | |
'removeFormat': FALSE | |
'table': | |
'table': FALSE | |
'list': | |
'ol': FALSE | |
'ul': FALSE | |
'link': | |
'a': TRUE |
@pumatertion: It's like that for a number of reasons, but it's certainly something that can be improved. I looked into the matter and it's not something that can be fixed easily due to how the libraries, that are used, work. I created a ticket for it: https://jira.typo3.org/browse/NEOS-228
I have a few questions (I'm trying to use method 1 with neos 1.2.5):
- some formatting options are working (e.g. b, i, u) others don't (e.g. right/center alignment).
- tags added by the editor (e.g. < b>) will appear in the browser title too (like: < b>page title</ b>) which I obviously don't want. (I had to insert spaces so that they don't get parsed by github's markdown)
- I don't get it to work without an extra wrapper tag (header, div, ...), which I don't need (you don't use one in your news example either).
Any advice would be greatly appreciated!
Thx in advance :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently i have a Partial Template holding some node informations and this should provide inline editable features like this:
Is it realy needed to have such complex rendering as you described above?
Something like this would be perfect?
neos:node.editable node="{node}" property="title" tag="caption" ..
neos:node.editable node="{node}" property="abstract" tag="h6" ..
neos:node.editable node="{node}" property="foo" tag="anyTag" ..