The question is: How does your plugin convert the path to its actual page? Is there any logic you can use or do you use page fields etc.? And why do you want to do this in the first place? I’m just trying to understand what you want to do here.
Ah, so it’s the other way around. You don’t need the mapping route -> page but page -> route.
This won’t work out of the box, as Kirby doesn’t know about your custom routes and the custom logic you use for them. To change the links to your routed pages, you can use a page model and set the url method on it to override the URL with a custom one.
Have a look at the docs. A page model can override an existing page method, in this case that would be the page URL:
Suppose you were using a route that omits the blog folder from the url when accessing an article, you would use a page model (/site/models/article.php) like this for the article.php template.
<?php
class ArticlePage extends Page {
public function url() {
return url() . '/' . $this->uid();
}
}