Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Sean Mooney 131 posts 158 karma points c-trib
    Jun 27, 2017 @ 12:27
    Sean Mooney
    0

    Linkpicker overlay Class option

    I would like to add a "Class" option to the linkpicker overlay. This would give the editor the option to set a css class on the link that they are creating. Many times we have clients that use custom styled links (buttons, CTAs, etc.).

    In the past I have been able to replace the linkpicker dialog and TinyMCE plugin with updated version to achieve this. It looks like that is no longer being used in v7.6.3

    Any idea where I would start? I don't mind making a PR once I know the right area to be working in.

  • Shannon Deminick 1526 posts 5272 karma points MVP 3x
    Jun 28, 2017 @ 05:18
    Shannon Deminick
    0

    Can't you just use the normal CSS class targeting for the RTE to target an 'a' tag so that the 'a' tag styles show up in the style drop down when the client selects the link and they can style accordingly after the link is inserted?

  • Sean Mooney 131 posts 158 karma points c-trib
    Jun 28, 2017 @ 12:10
    Sean Mooney
    0

    I have tried that in the past and there are a couple of issues.

    1. If I set the stylesheet property alias to be "a.button", then if I select an existing "a" tag and choose the button class nothing happens. If I select a section of text and then chose the button class (before making if a link) it wraps the entire contents in an "a" tag with just the class no href (which makes it show as an anchor in the RTE)

    2. If I set the stylesheet property alias to be ".button", then if I select and existing "a" tag and choose the button class it adds an additional span tag with the class button. This isn't the worst thing in the world but it's not the clean HTML that we are used to writing.

  • Sean Mooney 131 posts 158 karma points c-trib
    Jun 28, 2017 @ 13:16
    Sean Mooney
    0

    I found the areas that need to be changed, and have created a PR for this: https://github.com/umbraco/Umbraco-CMS/pull/2021

Please Sign in or register to post replies

Write your reply to:

Draft