Search code examples
mobileaccordion2sxc

2sxc: Accordion App - Open / Close section state regarding of desktop / mobile view


Because 2sxc Accordion App have in settings "Initially open/close" switch for each section, I wonder is it possible to tweak this in some way to get Accordion initially open for desktop page view and initially closed for mobile page view? It would save space / scrolling time and look more appealing in mobile page view.

Or just take this as idea for some next version of this App.


Solution

  • This would be fairly easy to do. I suggest you do the following:

    1. The toggle for open/close could be replaced with the boolean-tristate, so you have a true (open), false (closed) and null (automatic).
    2. Then adjust the razor code a bit to make this happen.

    If you got it to work, it would be awesome if you could contribute your code to the app in github: https://github.com/2sic/app-accordion