Psmb.FlatNav
Psmb.FlatNav copied to clipboard
Control the destination on click
I have a structure where I have several pages and inside the pages I have products.
NodeTypes are like that:
vendor.project:Document.Page
└── vendor.project:Content.Product
vendor.project:Document.Page
└── vendor.project:Content.Product
I would like to see in FlatNav all the Products and when I click on the item in the list I would like to see the Page with the product in it.
I thought with q(node).closest("[instanceof vendor.project:Document.Page]").get(0).path
I could get it but maybe I missunderstand that. How can I control the destionation when clicking on the node?
Settings.yaml
tags:
label: Tags
icon: tag
type: flat
query: 'q(node).find("[instanceof vendor.project:Content.Product]").sort("title", "ASC").slice((page - 1) * 20, page * 20).get()'
newReferenceNodePath: 'q(node).closest("[instanceof vendor.project:Document.Page]").get(0).path'
newNodeType: 'vendor.project:Content.Product'
Im interested too, maybe @dimaip or @skurfuerst can help? What "should" happen if I click on a Node in the FlatNav? In my Project the backend show a loading bar forever (without any network request).
Hey guys, sorry for the delayed reply... My Github notifications are a mess... I don't think that would work with the current implementation unfortunately.
Thanks for your reply @dimaip
Can you specify:
What "should" happen if I click on a Node in the FlatNav?
Actually the backend will show a loading bar forever 🤔
I suppose if you click on a document node, it should navigate to it.
Having content nodes wasn't originally planned in flatnav, but I guess we can navigate to the parent document node of a given content node?
I suppose if you click on a document node, it should navigate to it.
Sorry, i forgot to mention im using a content node. Looks like this causes the issue.
Having content nodes wasn't originally planned in flatnav, but I guess we can navigate to the parent document node of a given content node?
Sounds like an awesome Feature 🤩 Still looking for an intuitive way to manage nodes (without a document) like Tags, Calendar-Events and stuff like that. Is there a way to sponsor the implementation of this feature @dimaip?
Ooooh honestly I'm a bit overbooked at the moment... I can provide some guidance and reviews for free, but not sure I can promise to implement it myself.
Ooooh honestly I'm a bit overbooked at the moment
No Problem. I just wanted to ask.
I can provide some guidance and reviews for free, but not sure I can promise to implement it myself.
This sounds like an awesome offer 👍
Looks like getNewReferenceNodePathAction() gets the nodeContextPath
There I should be able to check if its a Document or Content-Node and return the parent DocumentNode 🤔
Let me try to change this if this is the "right way" to go.
@paavo did you ever find a solution to solve the problem?
@paavo did you ever find a solution to solve the problem?
no, im sorry @signalwerk