-
-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect permalinks #189
Comments
FYI: because this issue is quite the big deal in a current project I've fixed it like this for now: src/components/Buttons/Link.js submit: (values) => {
this.input.$panel.dialog.close();
delete values.title;
values.text = values.text || contents || null;
+ values.href = values.href.replace('/@/page/', 'page://');
this.insertLink(values);
} Of course a better solution would be to reuse the textarea dialog but I generally have no idea what I'm doing. |
After some time studying Kirby's code I think I know now why/how textarea and writer insert different links:
Maybe this helps someone in understanding the problem at hand. Or future-me at least. |
Update: the I had to change my hacky fix to this: submit: (values) => {
this.input.$panel.dialog.close();
delete values.title;
values.text = values.text || contents || null;
- values.href = values.href.replace('/@/page/', 'page://');
+ values.href = values.href.replace(/.*\/@\/page\//, 'page://');
this.insertLink(values);
} |
Keeping this here for reference: https://forum.getkirby.com/t/how-should-plugins-handle-the-link-dialog-with-uuids/31887 |
The markdown field inserts permalinks in a different structure compared to the textarea field:
This is a problem in the frontend, where page links are not correct:
It also does not help to run permalinksToUrls() on the field.
The text was updated successfully, but these errors were encountered: