Uri to panel page url

Hi what is the proper way to link inside the panel?

If i am making section or field that links to other page… as far as i know there is no panelUri so i am doing simple dumb replace of / to +.

<k-link :to="link.replace("/", "+");"></k-link>

or i do in PHP.

The point is if the simple replace is enough? I asume there is some method on frontend or backend for this? I mean it would maybe make sense to have this on k-link component?

There’s panelUrl($relative = false).

You can use this.$api.pages.link(id):

1 Like

Thank you for responses!

from the source @distantnative posted it indeed seems that it is simple replace i am not sure what is different this regex does

id.replace(/\//g, "+");
and
id.replace("/", "+");

But that just means i can do it at k-link.

Thank you!

hi,

do yo know how to use properly this.$api.pages.get() method to retrieve some field from a page id??

i

The topic I needed!

I personally went into Kirby’s app.js code to get more information where I found everything I needed to learn about those this.$api