edward-shen / MMM-pages

Add pages to your MagicMirror²!
MIT License
109 stars 29 forks source link

Button input to switch pages #27

Closed bigscinto420 closed 4 years ago

bigscinto420 commented 4 years ago

Hey dude, I have the fixed modules and everything I want set up but I can't for the life of me figure out how to get MMM-Buttons to make it switch. I noticed there needs to be a page number in the payload but I really just want to switch between my fixed modules and then push the button and it shows all of them. Any advice?

edward-shen commented 4 years ago

You can do a two page setup, where one of the pages is just empty; e.g. one page is your all your modules that aren't fixed, and another that's just an empty page so that when you increment (or decrement) the page, it effectively just hides the modules you don't want showing all the time.

edward-shen commented 4 years ago

As for setting up MMM-Buttons, assuming that you have your buttons set up properly, your config should have be something like

notification: "PAGE_INCREMENT",
payload: {}

Note that the payload can be empty, as it defaults to incrementing (or decrementing) the page by one.

edward-shen commented 4 years ago

Hey, I'm going to close this issue due to no response. Feel free to reopen this and comment if your problem still isn't solved.