Skip to content

page does not point to the current page in a query when parent is set #7930

@dgsiegel

Description

@dgsiegel

Description

In my setup I have both page blueprints for author and article as well as parent pages authors and articles for both. On the author page, I do have a section listing all articles by the author:

relatedArticles:
  type: pages
  create: false
  empty: "No items found"
  sortBy: status desc title asc
  query: page("articles").childrenAndDrafts.filterBy('author', '*=', page.uuid)

The field author on the article blueprint is a simple pages field. Now I'd like to have the access to create new articles from within an author page. Hence I change create to create: article. As a new article should live below articles, I also set the parent to page("articles").

Now the query does not return any matches anymore, as page.uuid refers to the uuid of the parent. There doesn't seem to be a way to access the actual page, e.g. model also points to the parent.

I know that I could create a collection or page method in order to work around this, but I feel this should not need a workaround needing a custom plugin.

Your setup

Kirby Version
5

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions