Welcome to the in5 Answer Exchange! This a place to get answers about in5 (InDesign to HTML5) and make requests.
0 votes
Hello sorry for my writing in English. In5 I want to export in a job to look from different devices (web, mobile, etc). I created the various alternative designs but do not know how to differentiate the device and display format correctly.

Now or viewing a web format, iPad, Android or other but no difference.

Thank you.
in how_to by (200 points)
  

1 Answer

0 votes
 
Best answer

Update: Responsive Layouts are coming to in5 v3.6:
https://www.youtube.com/watch?v=JGLpLulJrNI


You can create a landing page where the user chooses, like so

educabilidad landing page for different versions

For automatic detention with JavaScript, you might use something like the following.

If you create a separate landing page, it might have code like this included:

var uAgent = navigator.userAgent.toLowerCase(), isIPad = uAgent.indexOf("ipad") > -1, isAndroid = uAgent.indexOf('android') > -1;
if(isIPad){
    window.location.assign('/pathToIPadVersion/');
} else if (isAndroid){
    window.location.assign('/pathToAndroidVersion/');
} else {
    window.location.assign('/pathToWebVersion/');
}


Alternatively, you could take the web version of your layout and attach the following as a .js file using the Resources section:

if(isIPad){
    window.location.assign('/pathToIPadVersion/');
} else if (isAndroid){
    window.location.assign('/pathToAndroidVersion/');
}

This will redirect for iPad and Android, but otherwise do nothing (and display the web version).

Hope that helps!

by (197k points)
edited by
I've closed the separate issues about where to put the code, and I'll answer that here.

In the first example, you'd create your own HTML landing page and put the JavaScript inside a <script> tag within the <head> tag.

For the second example, save this code into a .js file and attach as a Resource in your main InDesign file.

More on attaching a Resource: https://ajarproductions.com/in5course/?lesson=resources