Skip to main content
Level 2
11月 22, 2021 8:51 上午 UTC
已解決

Mobile and Desktop view

Hello AEM community,

 

I'm new to AEM and I want to know if there is a way to identify if the current view is on mobile or desktop on code level(methods or properties on AEM that I can use to identify) without using the viewport. I'm creating Image component that the author can use 2 images for desktop and mobile option. Thank you ! 

 

此主題已關閉回覆。
Kiran_Vedantam
Community Advisor
11月 22, 2021 9:50 上午 UTC

Hi @aemstarternewbie 

 

If you are wanting to do it in CSS code, used media-queries. You should not check it in the backend due to caching issues.

 

Similar post: https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/aem-6-3-to-detect-from-desktop-or-mobile-from-which-the-request/td-p/387366

 

Thanks,

Kiran Vedantam.

4 則回覆

Kiran_Vedantam
Community Advisor
Community Advisor
11月 22, 2021 8:56 上午 UTC

Hi @aemstarternewbie 

 

You can use the small devices icon on top of every page on edit mode to move from desktop to devices

 

Hope this helps.

Thanks,

Kiran Vedantam.

翻譯
Level 2
11月 22, 2021 9:11 上午 UTC

Thank you for that. What I mean is on code level. Is there method or properties that I can use in AEM ? 

翻譯
Kiran_Vedantam
Community Advisor
Community Advisor
11月 22, 2021 9:50 上午 UTC

Hi @aemstarternewbie 

 

If you are wanting to do it in CSS code, used media-queries. You should not check it in the backend due to caching issues.

 

Similar post: https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/aem-6-3-to-detect-from-desktop-or-mobile-from-which-the-request/td-p/387366

 

Thanks,

Kiran Vedantam.

翻譯
Bhuwan_B
Community Advisor
Community Advisor
11月 22, 2021 10:27 上午 UTC