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.

    MMM-Page-Selector: A page switcher that can set positions of modules

    Scheduled Pinned Locked Moved System
    94 Posts 14 Posters 82.5k Views 15 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.
    • rudibaraniR Offline
      rudibarani Project Sponsor @Veldrovive
      last edited by

      @veldrovive
      Thanks again for implementing the current page as “dynamic” class. If I get it right, you had to code procedures to add and remove the page class when switching pages.

      Ok, the development branch now has support for the new class name changes. When a module is shown on a page, it will be given the class page_{Current Page} and then the class will be removed when the module is hidden.

      Would it be possible to make these procedures accessible via notifications? I am still looking for a way to add and remove classes based on external triggers. A scheme could be like this:

      Notification: "MMM_Page-Selector_Update_Class"
      Payload: {"add":["Module_1_Name:ClassA_to_add", "Module_2_Name:ClassB_to_add"], "remove":["Module_3_Name:ClassC_to_remove", "Module_4_Name:ClassD_to_remove"]}
      
      1 Reply Last reply Reply Quote 0
      • V Offline
        Veldrovive Module Developer
        last edited by

        @rudibarani
        If I am understanding what you are asking for correctly, this function seems to be out of the scope that Page-Selector encompasses. I would develop a module to include this functionality, but I have been inactive in the world of Magic Mirror as of lately. As it stands, I would post this request to the module suggestions forum or ask somebody to include it in a module that has a closer association with this type of purpose. MMM-Remote-Control could be a good candidate.

        rudibaraniR 1 Reply Last reply Reply Quote 0
        • rudibaraniR Offline
          rudibarani Project Sponsor @Veldrovive
          last edited by

          @veldrovive
          OK - thanks for the reply anyway!

          S 1 Reply Last reply Reply Quote 0
          • S Offline
            smarthome @rudibarani
            last edited by smarthome

            Hi all

            To make MMM-page-indicator work with MMM-Page-Selector, we must add MMM-page-indicator in to pages

            {
            			module: "MMM-page-indicator",
            			position: "bottom_bar",
            			"pages": {"Home": "bottom_bar", "News": "bottom_bar","Weather": "bottom_bar","Entertaiment": "bottom_bar","Smarthome": "bottom_bar","System": "bottom_bar"},	
                      	config: {
            			pages: 6,
            			}
            		},
            
            1 Reply Last reply Reply Quote 0
            • S Offline
              smarthome @Johans
              last edited by smarthome

              @Johans

              pages: "all",
              

              You forgot the quotation mark before and after pages

              "pages": "all",
              
              
              1 Reply Last reply Reply Quote 0
              • B Offline
                Brandenborg
                last edited by

                I love this module especially in use together with the MMM-navbar.
                Is there any config using existing code that will let me make it return me to “default” page after a given period of time after changing page?

                V 1 Reply Last reply Reply Quote 0
                • V Offline
                  Veldrovive Module Developer @Brandenborg
                  last edited by Veldrovive

                  @Brandenborg
                  This is not a default function of this module. However, if you can edit a small amount of code, it should be easy to implement.
                  Just copy these lines of code right after line 235 of MMM-Page-Selector.js. This lines should be selectPage(payload);

                  clearTimeout(self.default_timeout);
                  if(![0, this.config.defaultPage].includes(payload)){
                      self.default_timeout = setTimeout(() => {
                          selectPage(this.config.defaultPage);
                      }, TIME)
                  }
                  

                  Then just replace TIME with the number of milliseconds you want to remain on the page before it automatically switches back to default. You may also have to change the 0 in the if statement if your default page isn’t at the 0th position.

                  B 1 Reply Last reply Reply Quote 1
                  • B Offline
                    Brandenborg @Veldrovive
                    last edited by

                    @Veldrovive thanks a lot. I should manage that.
                    I recon the 0 position is the first page I define the contents of?

                    V 1 Reply Last reply Reply Quote 0
                    • V Offline
                      Veldrovive Module Developer @Brandenborg
                      last edited by

                      @Brandenborg
                      The 0 should be the position of your default page in the page list. The furthest left is 0.

                      B 1 Reply Last reply Reply Quote 1
                      • B Offline
                        Brandenborg @Veldrovive
                        last edited by

                        @Veldrovive
                        Thanks. And thank you for a really useful module!

                        1 Reply Last reply Reply Quote 1
                        • 1
                        • 2
                        • 6
                        • 7
                        • 8
                        • 9
                        • 10
                        • 10 / 10
                        • 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