Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Control the destination on click #51

Open
signalwerk opened this issue Aug 8, 2021 · 9 comments
Open

Control the destination on click #51

signalwerk opened this issue Aug 8, 2021 · 9 comments

Comments

@signalwerk
Copy link

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'
@paavo
Copy link

paavo commented Jan 6, 2022

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

@dimaip
Copy link
Member

dimaip commented Jan 20, 2022

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.

@paavo
Copy link

paavo commented Jan 21, 2022

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 🤔

@dimaip
Copy link
Member

dimaip commented Jan 21, 2022

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?

@paavo
Copy link

paavo commented Jan 21, 2022

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?

@dimaip
Copy link
Member

dimaip commented Jan 21, 2022

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.

@paavo
Copy link

paavo commented Jan 21, 2022

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.

@signalwerk
Copy link
Author

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

@paavo
Copy link

paavo commented Nov 10, 2022

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

no, im sorry @signalwerk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants