Displaying content only on mobile devices

To detect mobile devices, smartphones or tablets, Webasyst provides programming method $wa->isMobile(), which you can use in the HTML code of your website pages or design templates.

Example of use:

{if $wa->isMobile()}
    text for mobile devices
{else}
    text for desktop PCs and laptops
{/if}


Displaying content only on mobile devices and displaying nothing on PCs and laptops:

{if $wa->isMobile()}
    text for mobile devices
{/if}


Displaying content only on PCs and laptops and displaying nothing on mobile devices (use exclamation mark to add negation to the condition):

{if !$wa->isMobile()}
    text for desktop PCs and laptops
{/if}

0 comments

    Posting new comments is disabled for this topic.


    Раздел помощи работает на основе приложения «Хаб»