ach:1562713678 wrote
suisse wrote
I use the sectiontoggle plugin and the option `mobile_alt` was set to `dokuwiki`
That is so weird. In my opinion, the sectiontoggle plugin has no business having such an option as choosing a different template for mobile has nothing to do with toggling sections. :huh:
From what I understand from the plugin's page (without ever having tried it) I assume that the idea is to use the section toggles on mobile only. To decide if the user is using a mobile phone, the plugin sniffs the user agent header. It could stop there but the plugin also tries to be clever and decides that it should not only make the sections togglable but also ensure a good overall mobile experience by switching the template to the default one (assuming that other templates provide a worse mobile experience). turnermm points out that this behaviour can be disabled.
Personally, I see two problems with this
* as ach points out, switching the template seems to be out of scope for this plugin (and unexpected by users)
* detecting mobile use via mobile browser is a bit archaic and may actually disagree with what the rest of the template does for mobile detection
Modern mobile detection does not care for the actual device at all, but uses media queries to determine the screen size/resolution. Ideally this plugin and the template should use exactly the same break points to provide a streamlined user experience. I haven't looked at the code - this might actually be very hard to implement. But I thought to add my two cents.