Hey guys,
how I can get the variable “path” in startingPoint in my ts2
subMenu = Menu {
entryLevel = 1
templatePath = ‘resource://My.Proj/Private/Templates/TypoScriptObjects/SubMenu.html’
maximumLevels = 2
path = ${q(node).parent().property(‘uriPathSegment’)}
startingPoint = ${q(site).children(’[uriPathSegment=“path”]’).get(0)}
}
christopher
(Christopher Hlubek)
February 4, 2016, 9:02am
2
You can reference a property on the same object level with this.path
, so the example would read:
subMenu = Menu {
entryLevel = 1
templatePath = 'resource://My.Proj/Private/Templates/TypoScriptObjects/SubMenu.html'
maximumLevels = 2
path = ${q(node).parent().property('uriPathSegment')}
startingPoint = ${q(site).children('[uriPathSegment="' + this.path + '"]').get(0)}
}
I can’t tell if this is logically right, but the variable will be used as you expected.
Thank you christopher.
I have another problem.
How can I show the sites on the same level? entryLevel = 0 does not work
christopher
(Christopher Hlubek)
February 4, 2016, 5:20pm
4
You can set the itemCollection
property on Menu
to explicitly specify a collection of nodes that should be in the menu (e.g. itemCollection = ${q(node).children('[instanceof TYPO3.Neos:Document]')}
should work) but I guess there’s something wrong with startingPoint
when using entryLevel = 0
but it’s hard to tell.
Maybe test that setting in the Neos demo site and if it doesn’t work there it should be easy to replicate and fix a bug (if there is one).
Hmmm, thank you but unfortunately it does not work.
I want a menu of the other pages in the same “node” like:
Test1
Test2
–Test2page1
–Test2page2
–Test2page3
–Test2page4
–Test2page5
-Test3
–Test3page1
–Test3page2
–Test3page3
E.g. on --Test2page1 I want to see a menu with
–Test2page1
–Test2page2
–Test2page3
–Test2page4
–Test2page5
and e.g. on --Test3page2 a menu with
–Test3page1
–Test3page2
–Test3page3