Is there a parameter to detect the skuid page is loaded on mobile.

  • 1
  • Question
  • Updated 3 years ago
  • Answered
I have a SKUID desktop Page, which needs to be displayed when loads from a mobile (Salesforce1), I need to hide some information if the page is loaded via Salesforce1.

How could I do this with SKUID.

Thanks  
Photo of Hasantha Liyanage

Hasantha Liyanage

  • 1,446 Points 1k badge 2x thumb

Posted 3 years ago

  • 1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Your VF override page can have some logic in it that would add a URL parameter to the page based on what it finds about the device being used to see the page.  Then your conditional rendering could be done based on that URL parameter. Below is a quick and dirty example. 

<apex:page>
<script>window.location = ‘/apex/skuid__UI?page=MyPage&sf1=‘ + (sforce.one ? ‘true’ : ‘false’);</script>
</apex:page>


You could do this to conditionally render sections of your page based on device,  viewport size,  whatever else is reported back from the browser in this page. 
Photo of Hasantha Liyanage

Hasantha Liyanage

  • 1,446 Points 1k badge 2x thumb
Thanks for the reply Rob, another question I got is that, what if I need to render a button and hide if the user is logged in via salesforce1