• 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.

MMM-ImageSlideshow need help adding an interesting feature

Scheduled Pinned Locked Moved Troubleshooting
imageslideshowmykle1newfeatureconfig.js
4 Posts 2 Posters 1.9k Views 1 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.
  • C Offline
    cjkj_06
    last edited by yawns Mar 1, 2018, 6:52 AM Mar 1, 2018, 2:24 AM

    Greetings !
    Very useful module by @MYKLE1
    It puts images on the mirror based on the path given
    Basically it works fine for me !!

    I want to add following feature
    -> Based on my calendar event, the module should choose which path to grab images from
    e.g. If my today’s event is “Jack’s birthday”, then it should pick images from the path: module/imageslideshow/Jack_Birthday
    in other cases, the module should pick images from designated default area
    Isn’t that interesting ? :)

    I am currently trying to edit top config.js file with something like this
    Obviously it is incorrect, but still putting it out

    if (calendar.event == "Holi") {
    	var imagePath  = "modules/MMM-ImageSlideshow/Holi";
    } else {
    	var imagePath = "modules/MMM-ImageSlideshow/exampleImages", 
    }
    

    Which is the variable of “calendar” module, which gets me the event name, and how to use that var on config.js file ?
    PS: I dont know javascript , but i know C, python etc
    Appreciate any help
    Thanks
    Chirantan

    1 Reply Last reply Reply Quote 0
    • C Offline
      cowboysdude Module Developer
      last edited by cowboysdude Mar 1, 2018, 2:35 AM Mar 1, 2018, 2:33 AM

      Uh @Mykle1 didn’t write that one LOL

      But at any rate you could also do a switch statement like this:

      var text;
      var fruits = document.getElementById("myInput").value;
      
      switch(fruits) {
        case "Banana":
            text = "Banana is good!";
            break;
        case "Orange":
            text = "I am not a fan of orange.";
            break;
        case "Apple":
            text = "How you like them apples?";
            break;
        default:
            text = "I have never heard of that fruit...";
      }
      
      C 1 Reply Last reply Mar 1, 2018, 3:43 PM Reply Quote 0
      • C Offline
        cjkj_06 @cowboysdude
        last edited by Mar 1, 2018, 3:43 PM

        @cowboysdude
        True that, Thank you very much for replying

        Either if or switch, which variable from the default calendar module gives me the event name in text format ?
        and can I use that variable at config.js level ?

        Appreciate your time
        Chirantan

        C 1 Reply Last reply Mar 2, 2018, 1:13 AM Reply Quote 0
        • C Offline
          cowboysdude Module Developer @cjkj_06
          last edited by Mar 2, 2018, 1:13 AM

          @cjkj_06 I’m not really sure. I have never used that module so I don’t know anything about it :)

          I would look inside it and replace txt with perhaps your dir for images… just a thought.

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          1 / 1
          • First post
            1/4
            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