Forum Discussion

ChrisForbesE204's avatar
ChrisForbesE204
Community Member
2 years ago

Web Objects / Master Slides and Caching between slides..

Hi World,

Not sure if this is a simple yes / no question / scenario. 

I'm currently loading a Web Object (WO) (iFrame) that contains a sizeable amount of visual object data. Communication between SL360 and the object doesn't seem to be an issue via javascript.

The issue is reusing the WO without having to load it again if I revisit a slide. I could have a single slide with the WO on the base layer and a huge amount of layers, that hide and show etc, but this approach defeats flexibility and makes me run to the hills with a box of paracetamol.

As an example, I have slide 1 loading the WO. I interact with the WO and then move onto slide 2. Slide 2 uses the same WO, but has different interactions. How do I keep the same WO without reloading it between slides? 

So, I'm looking to reuse the WO throughout a module and essentially wish to load it only once. I've tried adding it to a Master Slide but it appears SL doesn't cache iframe WO content (i.e. it still loads data when jumping between slides that use the same Master Slide). Still further, a Lightbox approach wouldn't really be appropriate.

Hmmmmm. Thinking cap is fraying.

Thank you kindly. 

 

  • Testing on the LMS it seems to cache the WO ok - disabling the cache with the dev tools appears to substantiate this. All good. 

    • LonGoldstein-52's avatar
      LonGoldstein-52
      Community Member

      Hello Chris, This thread is a bit old but it seems to reflect a similar challenge I am trying to find a solution for. Could you clarify, is this a solution you found to keeping Web Objects loaded so you can return to them without reloading? If so, what exactly did you do with the LMS? How did you disable the cache? With what "dev tools"? 

      I am trying to find a way to load multiple web objects (satellite loop data players) such that I can switch between the WOs (data loopers) using tabs on a single page, where the WO continues in the same state it was left in, rather than reloading (and starting over) each time. 

      Any ideas welcome! 

      • SamHill's avatar
        SamHill
        Super Hero

        Hi LonGoldstein-52 I think you would need to use cookies for this, or, use Storyline variables to maintain state, and use JavaScript from your WOs to access the SL variables:

        const slplayer = GetPlayer();
        let ms1 = slplayer.GetVar("mystate1");
        if(ms1 === "visited")
        {
        // do this
        }else{
        // do that
        }
        

        Also, using the content of your WO to set the variable in Storyline

        const slplayer = GetPlayer();
        const btn = document.querySelector("button[id=button1]");
        btn.addEventListener("click",function(){
             slplayer.SetVar("mystate1","visited");
        })
        

        This will also ensure that, if using an LMS, the variable values will be stored between sessions.

        Is that the kind of thing you are looking for?

  • Hello Chris, 

    Happy to help!

    Looks like you were able to identify the expected behavior. Web Objets get loaded along with other slide contents, and there is no way for Storyline 360 to remember the current state of a website in a web object when learners navigate to another slide. This article explains how slides are preloaded: 

    I'll let the community chime in to see if they are able to share any tips on how to address a similar design requirement!