Copied to clipboard

Flag this post as spam?

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


  • j0w 31 posts 202 karma points
    Aug 01, 2019 @ 19:43
  • Nik 1625 posts 7295 karma points MVP 7x c-trib
    Aug 01, 2019 @ 20:16
    Nik
    101

    Hi Fant0hm

    There is a way to do this, however it will make the style available to all of your rich text boxes that have the formats drop down enabled.

    This guide here should help you set up the style. It was written for Umbraco 7, but I think it still works with Umbraco 8 but I've not tested it.

    https://www.justnik.me/blog/umbraco-rte-styles-another-way

    Thanks

    Nik

  • j0w 31 posts 202 karma points
    Aug 01, 2019 @ 20:59
    j0w
    0

    Hi Nik, thanks for the link. Just tried the basic code it gives us, but nothing happens.

    <config key="style_formats">
          [{"title": "Button", "selector":"a", "classes":"btn btn-primary"}]
        </config>
    

    If I go to any RTE in my website then add a link, it does nothing

    <p><a rel="noopener" data-udi="umb://document/0e358ac98eb646e29bf1c177897327b6" href="/{localLink:umb://document/0e358ac98eb646e29bf1c177897327b6}" target="_blank" title="Accueil">button</a></p>
    

    Didi you manage to make it work once on your own? Do I have to use a new RTE to have the changes applied or something?

  • Nik 1625 posts 7295 karma points MVP 7x c-trib
    Aug 01, 2019 @ 21:04
    Nik
    0

    Hey Fant0hm,

    Yeah I got this working on my own sites. It doesn't automatically add the class but it puts an entry in the formats drop down. Once you've put the link in you'll need to select the link and the you should be able select that option in the format drop down.

    Nik

  • j0w 31 posts 202 karma points
    Aug 02, 2019 @ 13:08
    j0w
    0

    Hey Nik, sorry for the delay.

    Thanks for the tip ! I did not noticed that it added a new style in the format dropdown ! Ahah

    It's all good, everything working fine!

    Thanks a lot for your help!

    Fant0hm

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies