[Neos] Put Text node as direct child on page
Dmitri Pisarev
dimaip at gmail.com
Tue Jan 27 13:57:55 CET 2015
I have written a longer reply, but Google Inbox didn't save it...
In short: ${q(site).children('headerLink1')} returns object wrapped in
FlowQuery, while ${q(site).children('headerLink1').get(0)} gets the object
itself. Just like in jQuery.
Regarding 'however' part, make sure you don't have that property also shown
in inspector. Also have inlineEditable: true for it.
But these are just while guesses, you'd have to debug yourself why it
doesn't work.
On Tue Jan 27 2015 at 3:45:03 PM Reinis Zumbergs <reinis.zumbergs at gmail.com>
wrote:
> Cool! I have it working .. (almost - see "However.." below)
> The issue was different, but the solution was in the file you linked to.
> I had TS2 line wrong. It should have been
> @override.node = ${q(site).children('headerLink1').get(0)}
> instead of
> node = ${q(site).children('headerLink1')}
> (Maybe someone can explain why my original line is wrong?)
>
> So working code is like this
>
> -- Configuration/NodeTypes.yaml --
> 'TYPO3.Neos.NodeTypes:Page':
> childNodes:
> headerLink1:
> type: 'TYPO3.Neos.NodeTypes:Text'
>
> -- Resources/Private/TypoScript/Root.ts2 --
> page.body.parts {
> headerLink1 = TYPO3.Neos.NodeTypes:Text {
> @override.node = ${q(site).children('headerLink1').get(0)}
> }
> }
>
> -- Resources/Private/Templates/Page/Default.html --
> ..
> <div class="header-link">
> {parts.headerLink1 -> f:format.raw()}
> </div>
> ..
>
>
> However, changes to the Text node behave strangely
> - I make a change. If in inspector, hit Apply
> - If in inspector, reload is triggered. Sometimes it reflects the change
> that I just did, sometimes not (but it doesn't affect further steps)
> - I hit Publish. Success, but when I reload frontend, the change is not
> there
> - Now, I make change to any page (fx change title) and Apply (don't have
> to publish) and the change goes live!
> - What? :)
>
> Maybe someone can replicate this? I'll gladly make a bug reports if it's a
> bug.
>
> _______________________________________________
> Neos mailing list
> Neos at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/neos
>
More information about the Neos
mailing list