Explore the community Forums Lectora Lectora Questions & Answers VAR(BrowserType) in Offline output

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #387785 Score: 0
    Profile photo of amanda hetherington
    amanda hetherington
    Member
    beginner
    intermediate
    friend finder
    curious george
    picture perfect
    wise owl
    contributor
    7 pts
    @ahetherington9113

    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

    Attachments:
    #387793 Score: 0
    Profile photo of Math Notermans
    Math Notermans
    Member
    contributor
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    LUC16 Attendee
    LUC16
    wise owl
    curious george
    129 pts
    @mnotermans5114

    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…

    #387991 Score: 0
    Profile photo of amanda hetherington
    amanda hetherington
    Member
    beginner
    intermediate
    friend finder
    curious george
    picture perfect
    wise owl
    contributor
    7 pts
    @ahetherington9113

    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

     

    #388003 Score: 2
    Profile photo of Tim K
    Tim K
    Member
    contributor
    beginner
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    wise owl
    curious george
    Group Member
    354 pts
    @timk

    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("file") > -1){
    Varoffline.set("yes");
    }else{
    Varoffline.set("no");
    }

    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”

    This post has received 2 votes up.
    #388107 Score: 0
    Profile photo of amanda hetherington
    amanda hetherington
    Member
    beginner
    intermediate
    friend finder
    curious george
    picture perfect
    wise owl
    contributor
    7 pts
    @ahetherington9113

    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

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.