16
Views
8
Comments
Solved
Check Device in expression

Hi All

I need to change my text content for desktop and mobile. Can I give IsDesktop and IsPhone condition in expression and change the content?

Rank: #97
Solution

No. You can do it on two ways:

  1. using the DisplayOnDevice but then you have to fill also the content for tablet
  2. using the if as I did on the last screenshot and you can then insert the content for the phone / tablet and desktop


Cheers,

João

Rank: #97

Hi Kavya,


You just need to use DisplayOnDevice from OutSystemsUI and then you just put on the placeholders the content you want to display in the different devices. Or you can use the IsPhone and IsDevice client actions to control your if on the screen:



Hope it helps.


Cheers,

João

Rank: #97

Hi kavya,


Yes, you can use the IsDesktop(), IsPhone() or IsTablet().

So if you want the content on your phone to be the same as on the tablet, you can just use the following:

If it is phone or tablet, it will go for the True branch (in my case "Text to show on Phone or Tablet"). Otherwise, it is desktop and it will go for the False branch (in my case "Text to show on Desktop").


Hope it helps.


Cheers,

João

Rank: #97

Yes, you can. You just drag an If to the screen and then write the condition IsPhone() or IsTablet, like on the screenshot below:


In this way, you place your text to display on phones and tablets on the True branch and the text to display on desktops on the False branch.


João

Rank: #97
Solution

No. You can do it on two ways:

  1. using the DisplayOnDevice but then you have to fill also the content for tablet
  2. using the if as I did on the last screenshot and you can then insert the content for the phone / tablet and desktop


Cheers,

João