Skip to content

Instantly share code, notes, and snippets.

@PereiraM
Created January 9, 2015 16:45
Show Gist options
  • Save PereiraM/7eda71af8c2f3cd20346 to your computer and use it in GitHub Desktop.
Save PereiraM/7eda71af8c2f3cd20346 to your computer and use it in GitHub Desktop.
ESI - device detect
<esi:assign name="touchoption" value="'(iPhone|iPod|Android|webOS|PlayBook)'"></esi:assign>
<esi:choose>
<esi:when test="$(HTTP_USER_AGENT) matches_i $(touchoption)">
<esi:text>
<!--#include virtual="mobile.html"-->
</esi:text>
</esi:when>
<esi:otherwise>
<esi:text>
<iframe src="desktop.html" height="780" width="940" scrolling="no" frameborder="0"></iframe>
</esi:text>
</esi:otherwise>
</esi:choose>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment