Currently the default homepage settings found in the admin panel and user preferences apply to both desktop and mobile. This is a very simple theme component that will allow you to specify a different default homepage for the small viewport version of your Discourse forum.
It is important to note that this will force anyone using a small viewport to navigate to the homepage you choose with this theme component. Your users will not be able to override the default homepage for the small viewport context via their user preferences at this point.
Theme Settings
There is one setting that will allow you to set the alternative homepage to one of the following:
latest (default)
new
top
categories
hot
Potential future work ideas
Allow users to override the default set via this component.
Thank you for this useful component.
Could you please help? While showing “Latest” by default on mobile, there is no option to choose “Categories” in top drop-down menu above topic list.
Thanks for creating this! How about future compatibility as the main Discourse app continues to evolve and is updated? Or is the theme component pretty future-friendly in that regard?
I got a deprecation notice for this great theme component in the developer console of the browser:
[THEME 50 ‘Force Mobile Homepage’] Deprecation notice: Accessing site.mobileView or site.desktopView during the site initialization can lead to errors and inconsistencies when the browser window is resized. Please move these checks to a component, transformer, or API callback that executes during page rendering. [deprecated since Discourse 3.5.0.beta9-dev] [deprecation id: discourse.static-viewport-initialization] [info: Designing for Different Devices (Viewport Size, Touch/Hover, etc.)]