Extending link dialog to add a rel attribute field

I’m trying to build a solution to the absence of rel attribute field in the link mark dialog in writer field. Described here for example. I’ve seen that in the feeback list of requests there is already an item requesting an option to add rel attributes to links, I upvoted it. But currently I’ve not found an existing solution.

One way I thought of doing this is by extending the Link dialog to add a “rel” field there and then change the output to add it as an attribute to the <a> tag

The list of Panel Dialogs in the documentation does not mention the link field or any other field in fact. I guess that’s because they are not considered in the same way as say the page.changeStatus dialog.

But then marks and other field related dialogs are not possible to edit by the method described by the documentation page about panel dialogs extensions? Or are they but then how to target them?

As I have understood it by reading other forum threads one solution would be to create a custom mark, a custom dialog associated to it. But it feels hacky and would mean duplicating the link field to do exactly the same thing, but with a slight variation.

Maybe I’m missing something here. Is it possible to extend field related dialogs, in the sense meant in the docs for panel dialogs ?

This is correct. The documentation page talks about how to extend/overwrite those core dialogs that are implemented via the backend (PHP).

The link dialog currently is not implemented via PHP but as a Vue component as it requires a lot of custom interactivity.

You would have to replace the k-link-dialog Vue component instead.

While I understand the urge to hack this yourself until it might be implemented in the core, you should know that this will require a lot of Vue and Kirby Panel expertise to pull off. Sorry that there isn’t an easy answer.

Understood. I’ll see if I can manage to hack a more simple solution to this problem as I would want to avoid tinkering with the Vue components and the Panel too much.

I a more prospective perspective I hope this “rel”/link attributes will have a solution in one form or another in future releases. The web basic building block is hyperlinks and for a lot of content based projects, even more so on a professional level, clients/users would need to be able to customize with precision how their link would behave.

Thanks for the answer.