Navigation

    MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord
    MagicMirror² v2.15.0 is available! For more information about this release, check out this topic.

    Module compliments

    Troubleshooting
    3
    6
    1585
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • X
      Xenobiologist last edited by Xenobiologist

      Hi there,

      how to format my compliments? Let’s say, I want to add a line break like
      or something like that?
      Is there an easy way, or do I have to split long texts into multiple compliments?

      I know, I could use iFrame or HTMLBox 🙂

      Thanks!
      Mega

      broberg 1 Reply Last reply Reply Quote 0
      • broberg
        broberg Project Sponsor @Xenobiologist last edited by broberg

        I don’t know if the compliments allows it, but you might try <br /> ?

        1 Reply Last reply Reply Quote 0
        • X
          Xenobiologist last edited by

          Guess what, I have tried that already.
          Within the quotes and outside the quotes with +

          None of those worked.

          1 Reply Last reply Reply Quote 0
          • Sean
            Sean Module Developer last edited by Sean

            line 153 in compliments.js

            var compliment = document.createTextNode(complimentText);
            

            Modify it.

            var compliment = document.createElement("div")
            compliment.innerHTML = complimentText
            

            I didn’t test it.

            broberg 1 Reply Last reply Reply Quote 1
            • broberg
              broberg Project Sponsor @Sean last edited by

              Yeah textnode doesn’t parse html.

              1 Reply Last reply Reply Quote 0
              • X
                Xenobiologist last edited by

                Oh man, I forgot that everything is right there in the “source files”, so that I can edit it myself.
                Thanks! That works!

                1 Reply Last reply Reply Quote 0
                • 1 / 1
                • First post
                  Last post
                Enjoying MagicMirror? Please consider a donation!
                MagicMirror created by Michael Teeuw.
                Forum managed by Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
                This forum is using NodeBB as its core | Contributors
                Contact | Privacy Policy