silverstripe-cms icon indicating copy to clipboard operation
silverstripe-cms copied to clipboard

"Link to external URL" displays short code when editing existing link

Open maxime-rainville opened this issue 5 years ago • 5 comments

Description

You can use the "link to external" option to edit existing link. However, if those links were created with the "link to a page" or "link to a file" option, it will display the short code in the link modal.

Steps to reproduce

  • Access a SiteTree in the CMS.
  • Add a Link to another page in the WYSIWYG.
  • Right-click your link and select the "Link to external URL" in the contextual menu.

Expected behaviour: Nothing appears in URL field. Actual behaviour: You'll see a short code string [file_link,id=4]

image

maxime-rainville avatar Jan 16 '20 02:01 maxime-rainville

@sachajudd Does @maxime-rainville expected behavior seem correct?

emteknetnz avatar Jan 21 '20 01:01 emteknetnz

@emteknetnz @maxime-rainville displaying an empty URL field makes sense. The person would be trying to change the link type, meaning the short-code is irrelevant. If they want to exit and return they can do so still.

Would there be the possibility to advise people they are about to change the link type with a notification in the modal? Could be a separate issue if its possible. For example... "The selected link type is different from what is currently set, by changing the link type some information may be lost."

clarkepaul avatar Jan 21 '20 05:01 clarkepaul

Would there be the possibility to advise people they are about to change the link type with a notification in the modal? Could be a separate issue if its possible. For example... "The selected link type is different from what is currently set, by changing the link type some information may be lost."

I'm thinking there's probably a meta discussion to have in here.

Adding a warning to the modal would probably be relatively easy, but generally speaking I think the way we managed link is kind of inelegant, both from a UX perspective and from a developer perspective. That's probably why there's so many link field addons.

In a perfect world, we would have a unified service for managing links, both as a stand alone field and in the WYSIYG. Each type of link you might want to manage would then become some sort of provider you plug into the link management service.

maxime-rainville avatar Jan 22 '20 03:01 maxime-rainville

Ingo's got a discussion started on this topic on the forum. https://forum.silverstripe.org/t/new-links-module/1642

maxime-rainville avatar Jan 22 '20 03:01 maxime-rainville

Related to https://github.com/dnadesign/silverstripe-elemental/issues/589

sachajudd avatar Feb 10 '20 04:02 sachajudd