MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    Change Modules name

    Scheduled Pinned Locked Moved Forum
    7 Posts 5 Posters 4.1k Views 6 Watching
    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.
    • P Offline
      pepemujica
      last edited by

      Hi everyone! I hope you’re finding very well!

      I have a doubt… is it possible to change the modules original name? For example change iFrame for News1

      Kind regards

      yawnsY 1 Reply Last reply Reply Quote 0
      • yawnsY Offline
        yawns Moderator @pepemujica
        last edited by

        @pepemujica
        Sure. Change the name of the folder, the name of the module.js and the module name inside the module.js file

        P 1 Reply Last reply Reply Quote 0
        • P Offline
          pepemujica @yawns
          last edited by

          @yawns great, and can I copy the folder, so I have the original module with it’s original name, and the copy with the custom name?

          Mykle1M cowboysdudeC 2 Replies Last reply Reply Quote 0
          • Mykle1M Offline
            Mykle1 Project Sponsor Module Developer @pepemujica
            last edited by

            @pepemujica

            Yes, just make the changes that @yawns stated above

            Create a working config
            How to add modules

            1 Reply Last reply Reply Quote 0
            • cowboysdudeC Offline
              cowboysdude Module Developer @pepemujica
              last edited by

              @pepemujica No.

              If you have [for example] MMM-This and you want MMM-That you have to change the folder name first to MMM-That…

              Now…inside that folder change MMM-This.js to MMM-That.js

              THEN open MMM-That.js and at the top it will have this line ---->

              Module.register(“MMM-This”, {

              That has to be changed to:

              Module.register(“MMM-That”, {
              Save the file…

              NOW some issues you may encounter… IF in MMM-That there is a line like this —>

              getStyles: function() {
              return [“MMM-This.css”];
              },

              That could potentially also need to be changed… IF you change it there you must go into the directory and rename MMM-This.css to MMM-That.css

              IF you do that then you need to open MMM-That.css and inside there will be this ->>>

              .MMM-This .photo {
              width:125px;
              height:125px;
              }

              They ALL have to be changed to MMM-That as well.

              Then you have renamed it …

              1 Reply Last reply Reply Quote 0
              • S Offline
                shbatm Module Developer
                last edited by

                On the Raspberry Pi, a shortcut to renaming all of the instances of ‘MMM-This’ inside the files is to use the following​ command. Don’t forget to navigate to the new module’s directory!

                find . -type f | xargs sed -i 's/MMM-This/MMM-That/g'

                You still need to rename the actual files.

                1 Reply Last reply Reply Quote 1
                • Mykle1M Offline
                  Mykle1 Project Sponsor Module Developer
                  last edited by

                  Or, for those not comfortable (yet) with the terminal, just about any text editor (including the Pi’s) can do a “Find and Replace”.
                  0_1496606106386_1.JPG
                  .0_1496606139636_2.JPG

                  Create a working config
                  How to add modules

                  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 Sam, technical setup by Karsten.
                  This forum is using NodeBB as its core | Contributors
                  Contact | Privacy Policy