Psmb.FlatNav icon indicating copy to clipboard operation
Psmb.FlatNav copied to clipboard

Control the destination on click

Open signalwerk opened this issue 3 years ago • 9 comments

I have a structure where I have several pages and inside the pages I have products.

image

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'

signalwerk avatar Aug 08 '21 02:08 signalwerk

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

paavo avatar Jan 06 '22 12:01 paavo

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.

dimaip avatar Jan 20 '22 15:01 dimaip

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 🤔

paavo avatar Jan 21 '22 08:01 paavo

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?

dimaip avatar Jan 21 '22 09:01 dimaip

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?

paavo avatar Jan 21 '22 11:01 paavo

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.

dimaip avatar Jan 21 '22 12:01 dimaip

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 avatar Jan 21 '22 14:01 paavo

@paavo did you ever find a solution to solve the problem?

signalwerk avatar Nov 07 '22 00:11 signalwerk

@paavo did you ever find a solution to solve the problem?

no, im sorry @signalwerk

paavo avatar Nov 10 '22 18:11 paavo