Skip to content

Control the destination on click #51

Description

@signalwerk

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'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions