Skip to content
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

[K4] 4.0 Compatibility #82

Open
afbora opened this issue Nov 27, 2023 · 15 comments
Open

[K4] 4.0 Compatibility #82

afbora opened this issue Nov 27, 2023 · 15 comments

Comments

@afbora
Copy link
Contributor

afbora commented Nov 27, 2023

UI broken for K4

screen-capture-1762-link - Mægazine-plugins test

Kirby 4.0.0-rc.4
PHP 8.1.23

@hdodov
Copy link
Contributor

hdodov commented Nov 28, 2023

I think the correct course here is to just deprecate the plugin. As of Kirby 4.0, it has its own link field, so it doesn't make sense to use a plugin.

@foxacid
Copy link
Contributor

foxacid commented Nov 28, 2023

I've used this plugin in quite a few projects over the years (many thanks!). While Kirby 4 has a much more flexible Link field than ye olde Url field it does not replace this plugin. Most notably, Kirby's built-in Link field is missing the extra text and popup options. It would of course be possible to supply those via additional fields but upgrading more complex v3 projects to v4 would be a major pain... Or am I missing something?

@owzim
Copy link

owzim commented Dec 8, 2023

same here, we need the text field for custom labels.

@afbora how did you even get it to install? I am in composer dependency hell right now, because the latest version 5.2.2 is only compatible with kirby 3.8 an higher but lower that 4. the last "compatible" version is 2.0.2 which is old and broken.

@afbora
Copy link
Contributor Author

afbora commented Dec 8, 2023

@owzim I installed manually (download zip file), not via composer.

@owzim
Copy link

owzim commented Jan 19, 2024

@foxacid same here. the core link field is a major let down compared to this one.

  1. no search
  2. looks totally different than other reference fields like files and pages
  3. behave differently
  4. misses things like label and popup
  5. the value stored in the page file is only the value, no type like email or page, you would have to parse and in some cases guess, what type of value is stored

Unfortunately I cannot mention @OblikStudio but we @bytepark would like to fork this project and continue support and development.

@foxacid
Copy link
Contributor

foxacid commented Jan 20, 2024

@owzim that sounds great. the plugin developer is @hdodov so your best bet is to reach out to him.

@afbora
Copy link
Contributor Author

afbora commented Jan 22, 2024

@hdodov I suggest you keep up-to-date the plugin for v3 and next kirby releases. I can say that extra features such as target, link text will not come to the core link field in the near future.

We recommend extending the core link field using object field:
https://getkirby.com/docs/reference/panel/fields/link#adding-target-link-text-etc

@owzim
Copy link

owzim commented Jan 25, 2024

@afbora @foxacid

I reviewed object field again, having it dismissed before because the preview for the link field sucks, but the pages, files and url field, selectively hidden based on selected types, it's very usable and quite pretty:

link:
  type: object
  fields:
    type:
      type: select
      label: Type
      options:
        page: Page
        image: Image
        url: URL
    page:
      type: pages
      max: 1
      when:
        type: page
    image:
      type: files
      max: 1
      when:
        type: image
    url:
      type: url
      when:
        type: url
    text:
      type: text
      label: Text
    newtab:
      type: toggle
      label: Open in new tab

image
image
image

drawer:

image

@distantnative
Copy link

@owzim the preview of the link field will be fixe din Kirby 4.1 (release pending):
298899833-067db9c3-a47f-4c3a-928b-7dc53a0ec8c0

@hdodov
Copy link
Contributor

hdodov commented Jan 30, 2024

@distantnative so Kirby will support adequate link fields natively and I could deprecate the plugin?

@distantnative
Copy link

@hdodov depends on what you consider adequate, I guess. Link field as it is in 4.0, betting a structure field preview in 4.1

@hdodov
Copy link
Contributor

hdodov commented Feb 4, 2024

I don't think there's a point in expanding this plugin for Kirby 4. As stated in the Kirby 4 release page about its link field:

Link to external URLs, internal pages, files, email addresses, telephone numbers, anchors or custom links.

fields:
  link:
    type: link

This is exactly what this plugin is trying to accomplish. Therefore, if you want extra functionality (or better one), you should push for it in the main Kirby link field. It's going to be better for everyone and make Kirby better in the process.

If someone really badly needs this plugin in Kirby 4, feel free to submit PRs.

@hdodov
Copy link
Contributor

hdodov commented Feb 4, 2024

Actually, nevermind. I decided to check out how hard it'll be to fix and it turned out to be easy. I published version 6.0.0 with support for Kirby 4. Check it out and let me know if it works alright.

@distantnative big props to the entire Kirby team for keeping things consistent between Kirby 3 and 4. 🙌

P.S. I still think it's better if people move away from this plugin and use the native Kirby link field.

@skraby
Copy link

skraby commented Feb 4, 2024

@hdodov , thanks for keeping plugin up-to-date. I tried v6 and it unfortunately breaks links functionality from within the Writer field. Should I create a new issue?

@hdodov
Copy link
Contributor

hdodov commented Feb 5, 2024

@skraby how does it break the links functionality? In what way? You could submit a new issue, yes, and include all the details I'm asking for there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants