Best solution to display referencing pages of a page in the panel (noob question)?

(I couldn’t find a proper answer in the forum, so I just ask.)

For a little event website I want to build with Kirby, I plan to have quite a number of different content types (= page templates), e.g. rooms, speakers, talk details (e.g. abstracts), talk schedules, topic categories, etc. All of those things are interconnected. For example, a talk can be held several times (= several linked talk schedules) and can have one or more speakers. The respective room, in turn, may not be directly linked to the talk, but must be linked to the talk schedule. (Because, for organizational reasons, a talk may be held twice, but not necessarily twice in the same room).

Having different page templates for all of these content types has the nice effect that I automatically have separate pages for each room, speaker, topic category, etc. – which I can use to display cumulated information in the frontend (e.g. all talks held by a certain speaker).

All these connections can be achieved with pages select fields in the panel. This is simple. But is there a way to at least see such connections in the panel when editing the linked page, too? Example: On page A there is a pages select field with page B selected. On page B (in the panel) this connection is not visible in any way by default.

Since I don’t want to fuss around with bidirectional editable connections using hooks, displaying “incoming” connections in the panel view of a certain page and being able to click on these connections to open the linking page would be totally enough.

Now my noob question: What’s the best way to achieve displaying these “incoming” connections?

  • Using a pages select field with the “disabled” option and a proper “query” property?
  • Or writing a little panel plugin that displays all pages with their panel links, based on a proper query?
  • Or is there some solution out there already wich I missed?

No, that wouldn’t work because a pages field doesn’t show anything unless you actively select something.

I think you could use the pagesdisplay plugin with a query in Kirby 3, Kirby 4 will allow queries in pages sections then.

Ah, I haven’t thought of pages sections. Cool that this will work in Kirby 4. :slight_smile:

Meanwhile the plugin will be a perfect solution. Thank you!

Gotta ask again, since I’m just trying to implement this using the plugin you mentioned.

The plugin works. But I’m not experienced enough with the query language to create a query that delivers the pages I’d like to display.

What I want to achieve sounds rather simple: In the blueprint of pages with the template “topic” I want to display a list of pages …

  • with the template “talk”
  • and which have the current topic selected in a pages field called “topics”.

Means: In the panel view of a “topic” page, I would like to display which “talk” pages are related to the current “topic”. While editors can’t change this relationship directly in the “topic” page panel view, they can click on one of the “talk” pages in the pagesdisplay section and change the relationship between the talk and its topics there. Comfortable enough.

The “topics” pages field of a typical “talk” page looks like this in a content file:

Topics:

- page://L5A6jcOAzVACFi6r
- page://j3hmjkLKoGjHuCkN

So I thought of something like this as a first – not yet dynamic – try in my “topic” blueprint:

sections:
  relatedTalks:
    type: pagesdisplay
    headline:
      en: Talks with this topic
      de: Vorträge zu diesem Thema
    query: site.index.template("talk").filterBy("topics", "*=", "L5A6jcOAzVACFi6r")

But the filterBy part has no effect in my tests.

Of course, the "L5A6jcOAzVACFi6r" string needs to be replaced by a reference to the UUID of the current “topic” page anyway.

What am I doing wrong?