magento2-page-builder icon indicating copy to clipboard operation
magento2-page-builder copied to clipboard

Hide elements on a page for just mobile

Open oefterdal opened this issue 2 years ago • 3 comments

Is there a way to hide elements/objects for just mobile on a page?

oefterdal avatar Jul 15 '22 11:07 oefterdal

Hi @oefterdal. Thank you for your report. To speed up processing of this issue, make sure that you provided sufficient information.

Add a comment to assign the issue: @magento I am working on this


m2-assistant[bot] avatar Jul 15 '22 11:07 m2-assistant[bot]

As I customer we want to be able to show/hide content for desktop/mobile. I would suggest to add a dropdown with breakpoint options where the user can select where to display the component / row / column. One can manually add the magento responsive classes as a workaround but this can be a bit to complicated for the non experienced end users.

amokato avatar Dec 01 '22 12:12 amokato

@amokato,

A similar issue has been reported in magento/magento2-page-builder#493. By "responsive classes", I presume you're referring to .pagebuilder-mobile-only and .pagebuilder-mobile-hidden?

As far as I know, Page Builder never generates inline stylesheets that contain media queries and, in my mind, nor should it. For example, if your theme has overridden @screen__m and Page Builder is using out-of-the-box breakpoints, you wind up with a front-end with inconsistent breakpoints, so I guess finding a middle ground where such classes - or dare I suggest more data-* attributes - are added based on responsive-based visibility toggling, configuration options added under Advanced Options, or an entirely new Responsive Options fieldset.

bluemwhitew avatar Feb 01 '23 19:02 bluemwhitew