Sorry, we don't support your browser.  Install a modern browser
This post is closed.

Link to page/file in writer field (picker UI)

The possibility for internal links (= link to another page) would be nice for the writer field.

4 years ago
6

I’m thinking about it. Since the writer field does not work like markdown, when we add the link of the page, it will save the absolute link that includes full url as HTML like http://example.com/some/page, not the dynamic link like (link: some/page). Do you think this is a problem?

3 years ago
D

Either way would be an issue, imagine if your page change slug, the link will then be broken. That’s why it’s necessary to have immutable id’s for internal linking.

3 years ago

Since we do not have an immutable id at the moment, also problems may occur in the links we give with the link() tag in markdown. The point I want to draw attention to here is the domain address. When we first make the site on localhost and then move it to the prod domain, links with localhost will not work. Is this an acceptable case?

3 years ago

At the moment this is our workaround: We add a base url and use the page slug of the target page in the link input.

3 years ago

I don’t think the domain should be stored

3 years ago

Do you think the links should be stored like this?

<a href="/some/page">Link to page</a>

<a href="/subfolder-kirby-installation/some/page">Link to page</a>
3 years ago

It would be best if there was a special mark for such an internal link so that the correct link tag can then be constructed in the backend when the field is rendered. However I don’t have a good overview over the writer field at the moment to tell if it’s possible and how this would be done.

3 years ago

I once again had to explain a customer how to link files with the writer field:

  1. upload file
  2. click on file
  3. click on url
  4. copy url
  5. select text
  6. click on link icon
  7. paste in url
  8. wash hands because you linked an internal file using an absolute url

While it could be:

  1. select text
  2. click on attachment icon
  3. upload file

Encore
The user replaced the file.

..drumroll..

And the link breaks.

Because: the copyd url contains a hash that (correctly) changes with the file.

@Tobias.f.wolf‘s concept where permalink page/file urls resolve to long urls at render time looks like a great idea.

2 years ago
6

It would be really helpful, if we could paste a permalink to a page or file in the url field like
page://wwZfUaAonRARD3oL?param1=val1&param2=val2#footer or file://MiS3i2Nc5wtVFltK.
It also wouldn’t be to hard to explain it to any panel user how internal linking works.
Right now it’s not possible to prepare some content on the dev server because the domain won’t be right, when the site goes online.

2 years ago
1
Changed the status to
In upcoming releases
2 years ago
5

Right now (in version 4), if you link to an internal page in the panel, it gets output with its permalink and not an absolute or relative URL in the frontend as suggested by @Tobias and @Felix Niklas . Is there a way to output the absolute or relative URL of such a link? I’m using the router of a frontend library and this breaks internal links at the moment.

a year ago
2
Changed the status to
Completed
a year ago
1

For anyone wondering, there is a field method now to replace permalinks with regular URLs: permalinksToUrls()

a year ago
2
H

Thank you silllli 🤓 That’s what I was looking for. Is there a way to make this the default behavior?

a year ago
1

I created this suggestion to make it the default behavior.

6 months ago