silverstripe / silverstripe-admin

Silverstripe Admin Component
BSD 3-Clause "New" or "Revised" License
25 stars 92 forks source link

TinyMCE 'Link text' field consistency across CMS #883

Open sachajudd opened 5 years ago

sachajudd commented 5 years ago

Currently when you right click in TinyMCE and select "Insert link" a modal appears which allows you to add 'Link text' and other details. Once inserting and re-editing the link you will notice the 'Link text' field has disappeared. Note: The 'Link text' field is also not present when text is already added and highlighted in TinyMCE.

It would probably be better to keep the UI consistent if the field 'Link text' is always present in the modal. See new content block link component issue for more information. See the Style guide for designs.

purplespider commented 5 years ago

Agreed. Also, there is no 'Link text' field at all when using the "Link to file" option. This means it's possible for CMS users to insert an empty (i.e. invisible) link if they use the "Link to file" option without first highlighting any text.

One possible solution for this could be to automatically insert the title of the file as the link text if no text had been previously highlighted.

It could also be nice for the "Link text" fields to be automatically populated for the "Link to email address" and "Page on this site" options, if no text had been highlighted. e.g. with the e-mail address or page name.

lerni commented 9 months ago

With latest (2.1.3 - just tested with that) the link insert dialog doesn't validate if no 'Link text' is present. This doesn't solve the reported issue but prevents empty links as @purplespider describes. Anyways +1 for populated Page-links!

Link-text-validation