Skip to content

Instantly share code, notes, and snippets.

@aertmann
Last active September 7, 2018 21:21
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • 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
@pumatertion
Copy link

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" ..

@aertmann
Copy link
Author

@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

@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