In a writer field, when creating a link to a internal page, as href value in the template is it possible to display the regular page link instead of the permalink ?
I’m trying Kirby 4 and it’s great. The new link dialog makes it possible to link any word(s) to a page, but the href attribute contains a permalink, wich is problematic in my case.
Otherwise, in the context of a blocks field, I don’t see any other option than to use the markdown field, wich is way less convenient for the user. But maybe you see one ?
For me linking from internal pages does not work.
After assignment source code looks like this: <a>notes</a>
The href attribute is missing.
If I call the page in the panel again, the link is not recognized at all.
Is this a (known) bug?
I use the starterkit with 4.0.0-beta.1
A hook that replaces the link and actually stores the result in the content wouldn’t be useful (because of what I wrote above), what you can do is replace those links when rendering, via a custom field method.
No it’s not published.
Which functions are you talking about ? formatSize() was specific to my project but if you think it could be usefulf to you of course I can share it.
I just ran into the same problem. It’s an odd decision to make Writer fields render permalinks only. This renders the field useless to many use cases where human-readable and SEO friendly links are desired. And this should be the default on any website.
If Kirby wouldn’t store links as permalinks/UUIDs in the writer field bun human-readable URLs, the whole benefit of UUIDs would be lost as those URLs would break with any slug change and couldn’t be recovered.
As with other fields, you might need to apply a specific field method to the field when rendering, e.g. how when using a textarea with KirbyTags you need to apply ->kirbytext() to render it correctly. For the writer field this is ->permalinksToUrls() to convert them to human-readable URLs. Not complicated.
We will explore in a future Kirby version if there could be a catch-all field method for writer fields, e.g. ->toWriterHtml() (though I don’t like that name particularly), that would apply this modification as well as others potentially, so one doesn’t have to remember multiple field methods but just this one.