• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
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.

Adding duplicate Modules

Scheduled Pinned Locked Moved Unsolved Troubleshooting
5 Posts 3 Posters 1.6k Views 3 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.
  • S Offline
    shipoffools1
    last edited by Mar 12, 2020, 12:13 AM

    Does anyone know how to add multiple iterations of the same module. E.g. if I wanted to show 3 city’s weather by using the same module 3 times with 3 different sets of data. Thank you!

    M 1 Reply Last reply Mar 12, 2020, 12:42 AM Reply Quote 0
    • M Offline
      Mykle1 Project Sponsor Module Developer @shipoffools1
      last edited by Mar 12, 2020, 12:42 AM

      @shipoffools1

      You could try this. It doesn’t always work.

      1. Copy and paste the intended module folder twice so that you now have 3. ( example module - weatherforecast.

      2. Rename one of the copied folders to weatherforecast2. Then open that folder.

      3. Rename the weatherforecast.css file to weatherforecast2.css. Open that file.

      4. Rename all instances of .weatherforecast to weatherforecst2. Save and close.

      5. Rename the weatherforecast.js file to weatherforecast2.js. Open that file.

      6. Edit the Module.register line to weatherforecast2. Inside the quotes only!

      7. Edit the getStyles: function() return line to read "weather-icons.css", "weatherforecast2.css". Inside the quotes only! Save and close.

      Follow the above instructions again with the third folder, renaming, AS ABOVE, to weatherforecast3.

      Then you need a config.js entry for each module, using the names of the original and the 2 renamed modules.

      Create a working config
      How to add modules

      S 1 Reply Last reply Nov 28, 2020, 3:20 PM Reply Quote 1
      • S Away
        sdetweil @Mykle1
        last edited by sdetweil Nov 28, 2020, 10:00 PM Nov 28, 2020, 3:20 PM

        @Mykle1 one addition

        if the module you are duplicating is one of the default modules, (located in the modules/defaults/ folder)
        put the copy back into the modules folder…

        modules in the defaults folder get special treatment from a hard coded list

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        M 1 Reply Last reply Nov 28, 2020, 9:48 PM Reply Quote 1
        • M Offline
          Mykle1 Project Sponsor Module Developer @sdetweil
          last edited by Nov 28, 2020, 9:48 PM

          @sdetweil

          Yo yo yo! Thanks for that speedy tidbit. (nearly 9 months)

          :laughing:

          Create a working config
          How to add modules

          S 1 Reply Last reply Nov 28, 2020, 9:59 PM Reply Quote 0
          • S Away
            sdetweil @Mykle1
            last edited by Nov 28, 2020, 9:59 PM

            @Mykle1 u want speed or accuracy?! 😆

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            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