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.

    Running the same module twice with different URL, but same content is being displayed (MMM-HTMLSnippet)

    Scheduled Pinned Locked Moved Troubleshooting
    6 Posts 2 Posters 1.0k Views 2 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
      sdetweil @kasperb
      last edited by

      @kasperb sadly the module is not designed to be used in multiples

      the problem is the url to get the html (which isn’t needed anyhow)
      the node helper sets up a ‘server’ to return the html,. and the web side calls to get it
      ‘/MMM-HTMLSnippet’

      but MM cannot have two servers with the same name, so first one wins…

      if you turn the two entries around, the resutls will be from the top one…

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      1 Reply Last reply Reply Quote 0
      • S Offline
        sdetweil @kasperb
        last edited by sdetweil

        @kasperb you could hack one module to get what I want.

        edit the second one, where u changed the name. change the

        /MMM-HTMLSnippet
        

        to

        /MMM-HTMLSnippet2
        

        in both .js files

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        K 1 Reply Last reply Reply Quote 0
        • K Offline
          kasperb @sdetweil
          last edited by

          @sdetweil Thanks for your response. When you say both *.js files, which ones exactly do you mean? There is only one *.js file in the folder with ‘MMM-HTMLSnippet’ in it.

          S 1 Reply Last reply Reply Quote 0
          • S Offline
            sdetweil @kasperb
            last edited by sdetweil

            @kasperb node_helper.js

            this.expressApp.get("/MMM-HTMLSnippet", (req, res) => {
            

            and
            MMM-HTMLSnippet.js

            wrapper.src = '/MMM-HTMLSnippet'
            

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            K 1 Reply Last reply Reply Quote 0
            • K Offline
              kasperb @sdetweil
              last edited by

              @sdetweil You’re right; I missed that one.

              Thank you - that did the trick and both versions of the module now work as expected.

              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