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

Port D8 Editor Advanced link, merge in core. #1777

Open
ghost opened this Issue Apr 2, 2016 · 18 comments

Comments

Projects
None yet
7 participants
@ghost

ghost commented Apr 2, 2016

While upgrading CKEditor to 4.5.5+, please add a decent link plugin.
I ported D8 Editor Advanced link, but it's only part of ckeditor_addon (it needs an updated backdropimage plugin, and of course a CKEditor library >= 4.5.5)
The anchor functionality is apparently lost again, although it can be restored with an id attribute to a link (just need a concrete text to apply the link to);
Additionally, it provides lightbox facility…
Real world screenshots :
capture d ecran 2016-04-03 a 00 15 26
capture d ecran 2016-04-03 a 00 13 34

@ghost ghost added the type - feature request label Apr 2, 2016

@ghost ghost added this to the 1.4.0 milestone Apr 2, 2016

@quicksketch

This comment has been minimized.

Member

quicksketch commented Apr 3, 2016

While upgrading CKEditor to 4.5.5+, please add a decent link plugin.

We'll do these things one at a time rather than all at once in a mega issue. The upgrading issue would be first if we can get just the upgrade handled without bundling it with anything else in #1560.

@klonos

This comment has been minimized.

Member

klonos commented Apr 3, 2016

👍 Yes please.

@quicksketch

This comment has been minimized.

Member

quicksketch commented Apr 3, 2016

As for this feature itself, I'd be interested to hear from others about how extensive we should make the link dialog. This should be entirely possible through a contrib module today (without replacing CKEditor) by form_alter'ing the link dialog that we have already. Any form elements that are put into that form will automatically be applied as attributes on the anchor tag.

Here's the current (very spartan) dialog for reference:
selection_098

@quicksketch

This comment has been minimized.

Member

quicksketch commented Apr 3, 2016

As for this feature itself, I'd be interested to hear from others about how extensive we should make the link dialog.

And of course if wanted we can make things options in the text format configuration, as we do with image uploading. So you could choose what features the link dialog should have when the link button is enabled. Here's what happens when you drag in the image button for example:

2016-04-02 17 45 02 338

@klonos

This comment has been minimized.

Member

klonos commented Apr 3, 2016

👍 for having the options upon drag to toolbar (so that admins can limit things that they don't want editors to be messing with), but we can always add an "Advanced settings" fieldset on our "spartan" link modal and add any additional options there + collapse it by default. That way we do not bloat the default dialog.

@ghost

This comment has been minimized.

ghost commented Apr 3, 2016

@quicksketch

We'll do these things one at a time

Unfortunately, you can't : the backdrop plugin, the ckeditor image2 widget, and ckeditor core API are imbricated at a very low level — you can't interchange any component 4.4 <> 4.5

To make it worse, links have no material existence on the editor screen, so they must be handled, at first instance, by the object they apply to.

To make it worse, the link may be inside the object, if the image is captioned or centered, or outside if it's not…

That's the only reason why I launched a separate ckeditor_addon project !

Again, see https://www.drupal.org/node/2510380 and http://dev.ckeditor.com/ticket/13885

@serundeputy serundeputy modified the milestones: 1.5.0, 1.4.0 May 13, 2016

@quicksketch quicksketch referenced this issue Sep 8, 2016

Open

[META] CKEditor/Rich text editor followups #1087

18 of 38 tasks complete
@jenlampton

This comment has been minimized.

Member

jenlampton commented Sep 8, 2016

There as been no activity on this issue since last release. Since next release is in one week, I'm bumping this to 1.x-future.

I have added this feature to the MEAT issue for rich-text editor tasks, and those could in theory get fixed at any time. That should mitigate the decrease in urgency that will happen by removing the 1.5 milestone from this issue.

@jenlampton jenlampton modified the milestones: 1.5.0, 1.x-future Sep 8, 2016

@klonos

This comment has been minimized.

Member

klonos commented Sep 8, 2016

I have added this feature to the MEAT issue for rich-text editor tasks, ...

😄 hungry @jenlampton ? 😄

@olafgrabienski

This comment has been minimized.

olafgrabienski commented Apr 20, 2017

Related: #1206 - [UX] CKEditor: Allow to browse and enter links of local paths (content, users etc.)

@BWPanda

This comment has been minimized.

BWPanda commented Sep 8, 2017

This should be entirely possible through a contrib module today (without replacing CKEditor) by form_alter'ing the link dialog that we have already. Any form elements that are put into that form will automatically be applied as attributes on the anchor tag.

@quicksketch I started trying to work on this for my own site (and the maybe a contrib module), but immediately realised that I don't think I can do what I want...

To make this as flexible as possible (some people want to add a class, others a rel attribute, and others need to create their own attributes (see my newly-created Featherlight module), I thought to make a single textfield where you could add whatever attributes you want.

Something in the form of: [attribute_key_a]=[attribute_value_a.1],[attribute_value_a.2] [attribute_key_b]=[attribute_value_b.1].
So then people could enter the following: class=my-class,another-class rel=gallery data-featherlight=image

But apparently the way this works is that form keys are automatically added as attribute keys and form values are added as attribute values. Is that correct? If so, how can I/we override this behaviour to do something like the above? This would save creating separate textfields for every possible attribute we want to add...

@BWPanda

This comment has been minimized.

BWPanda commented Sep 8, 2017

@quicksketch Ignore that. I've played a bit more and, based on your post here I worked out that I should be able to do what I want.

@BWPanda

This comment has been minimized.

BWPanda commented Sep 11, 2017

I have written some code (as a part of a site-specific module on my sandbox site) that allows users to add arbitrary attributes to a link via Backdrop's editor. However, one problem I am having is that you can't seem to add boolean attributes (e.g. data-featherlight) as they get removed somewhere...
Any ideas how/why boolean attributes get removed?

Here's my code: https://gist.github.com/BWPanda/cbd9bd9d43eb16a8a046004f289e02c5

@bradbulger

This comment has been minimized.

bradbulger commented Nov 26, 2018

I'm finding that even if I add an ability to add an id attribute to tags, I can't create links to it because #idstring gets converted to /base/path#idstring. I'm not sure where this problem should go? There are lots of CKEditor and link issues...

@klonos

This comment has been minimized.

Member

klonos commented Nov 26, 2018

Sorry @bradbulger, I don't quite get what you are trying to achieve and what does not work. Can you please provide detailed steps to reproduce the problem?

@bradbulger

This comment has been minimized.

bradbulger commented Nov 26, 2018

Should I make a new issue for it, then? I just wasn't sure if that would be the right thing to do. I have assigned an ID attribute to an element in the HTML, and I am trying to use the CKEditor link button to create an anchor link to it - like <a href="#top">go to the top</a>. The editor link widget saves that href value as "/base/path#top".

@klonos

This comment has been minimized.

Member

klonos commented Nov 26, 2018

Yep, sounds like a bug, while this issue here is a feature request. I'd file a separate issue.

@olafgrabienski

This comment has been minimized.

olafgrabienski commented Nov 27, 2018

There is a related open issue about internal anchor links via the link module: #1308. It isn't about CKEditor and there's another result if you try to use such links. However, maybe URL validation and/or encoding in CKEditor are partially based on URL validation of the link module.

@bradbulger

This comment has been minimized.

bradbulger commented Nov 27, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment