VAR(BrowserType) in Offline output

Using Lectora Inspire 17.3.1

Does anyone know if the VAR(BrowserType) reserved variable can be used to detect a title published for offline use? The Lectora help files (please see image attached), indicate that this variable should be populated with LectoraViewer if a title is published for offline use.

When I published a test with this variable populating a text box, and published as offline output, the textbox is populated with Netscape.

What I want to do, is configure certain actions to take place automatically if the output is offline, and other actions if the output is html.

Any advice would be appreciated.

Regards

Amanda

BrowserType.png

Discussion (4)

Not sure whether you can use that specific Var for it, you can detect it though. When the URI path is not http:// or https:// you can conclude its a local test...

Thanks Math.

What I'm trying to do, is have a conditional action that is based on whether the title is offline or html. I need to use the same title, and publish it for offline and for html, and have it behave differently depending on which output.

I thought BrowserType should work, because the help file says that it should show LectoraViewer if published for offline use.

Any advice would be welcome.

Regards

amanda

undefined

The help has not been updated for a while. Lectora doesn't use the Lectora Viewer any more. It's been changed to use Awesomium as the browser to display content published to offline. The good thing about this is that you now can use Javascript in offline content as well and check the url of the course.

Create a variable, e.g. "offline"

Add two actions on title level:

Action: Modify variable

Target: offline

Type: Set as empty

Action: Run javascript

Javascript:

if (window.location.href.indexOf(undefined -1){

Varoffline.set(undefined

}

The URL of the page will contain "file" if it's opened offline. You can use the variable in conditions, e.g.

Only if "offline" "equal to" "yes"

Excellent, thanks @timk

That's really helpful. I did all of that and got the var to change to 'yes', so I can now apply this to my tutorial.

Thanks for your help Tim and Math :)

Cheers

Amanda

Discussions have been disabled for this post