Skip to content

Instantly share code, notes, and snippets.

@aertmann
Last active September 7, 2018 21:21
Show Gist options
  • Save aertmann/f9c8a33e8720f7cb21be to your computer and use it in GitHub Desktop.
Save aertmann/f9c8a33e8720f7cb21be to your computer and use it in GitHub Desktop.
Inline editable properties for a document node (two different approaches) – TYPO3 Neos
<neos:contentElement.wrap node="{node}">
<header>
<neos:contentElement.editable property="title" tag="h1" />
</header>
</neos:contentElement.wrap>
page.body {
title = ${q(node).property('title')}
}
page.body {
header = TYPO3.Neos:Content {
templatePath = 'resource://TYPO3.NeosDemoTypo3Org/Private/Templates/Page/Default.html'
sectionName = 'header'
node = ${node}
title = ${q(node).property('title')}
}
}
<f:section name="body">
{header -> f:format.raw()}
</f:section>
<f:section name="header">
<header>
<neos:contentElement.editable property="title" tag="h1" />
</header>
</f:section>
'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
@jdreesen
Copy link

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