Forza Homepage Mobile

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 mobile view of your Discourse forum.

It is important to note that this will force mobile to navigate to the homepage you choose in this theme component. Your users will not be able to override the default homepage for mobile via their user preferences at this point.

Repository Link
https://github.com/tshenry/discourse-force-mobile-homepage

I don’t know if there’s anything to gain by including screenshots or putting a demo on theme-creator, but if anyone thinks otherwise, please speak up!

Theme Settings

There is one setting that allows you to set the mobile homepage as:

  • latest (default)
  • categories
  • new
  • unread
  • top

Installation

If you are new to installing theme components, check out @Johani’s excellent guide on theme components, particularly how to import a theme component and how to add the theme component to your main theme.

Future

  • Allow users to override the default we set in this component.

That’s it! Questions, comments, and suggestions are always welcome :slight_smile:

56 Mi Piace

Works like a charm. This is great mate!

4 Mi Piace

Great little component, just what I needed for my community!

Many thanks.

1 Mi Piace

Can you please integrate this into core settings.

Sitewide default in settings for mobile and desktop.

And user setting in user profile settings for mobile and desktop.

:wink:

9 Mi Piace

+1 for having different home page capabilities for mobile and desktop in core.

10 Mi Piace

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.

Exactly what I was after - thank you for this little component!

3 Mi Piace

Ottimo, grazie :folded_hands::folded_hands::folded_hands::folded_hands:

1 Mi Piace

Grazie per aver creato questo! :handshake: Che dire della compatibilità futura, dato che l’app principale di Discourse continua a evolversi e viene aggiornata? O il componente del tema è abbastanza “future-friendly” a riguardo?

2 Mi Piace

Questo componente Theme è super-semplice e praticamente a prova di bomba, secondo me! Solo un paio di righe di CSS e HTML senza impostazioni o altro di complicato.

3 Mi Piace

Ritengo ancora che questo dovrebbe essere unito al core come impostazione aggiuntiva, è incredibilmente utile!

10 Mi Piace

Un componente piccolo e semplice.

Naturalmente, gli utenti più esigenti hanno immediatamente iniziato a richiedere la possibilità di impostare le proprie preferenze di override.

Questo è utile per la stragrande maggioranza degli utenti normali, ma c’è ancora richiesta da parte dell’1% degli utenti più esigenti di poter eseguire l’override personale.

Concordo. Non è stato aggiornato per 7 anni ma è ancora utilizzato dai proprietari di Discourse.

1 Mi Piace

1 Mi Piace

Speranza per un aggiornamento

Questo è uno dei plugin indispensabili che deve essere aggiornato!:folded_hands:

L’ho aggiornato in una PR qui: DEV: update to initializer by awesomerobot · Pull Request #3 · tshenry/discourse-force-mobile-homepage · GitHub

@tshenry puoi dare un’occhiata e unire quando hai un momento?

6 Mi Piace

Unito! Grazie per la PR!

7 Mi Piace

Ho ricevuto un avviso di deprecazione per questo ottimo componente del tema nella console degli sviluppatori del browser:

[THEME 50 ‘Force Mobile Homepage’] Avviso di deprecazione: l’accesso a site.mobileView o site.desktopView durante l’inizializzazione del sito può causare errori e incoerenze quando la finestra del browser viene ridimensionata. Sposta questi controlli in un componente, un trasformatore o una callback API che viene eseguita durante il rendering della pagina. [deprecato da Discourse 3.5.0.beta9-dev] [id deprecazione: discourse.static-viewport-initialization] [info: Designing for Different Devices (Viewport Size, Touch/Hover, etc.)]

2 Mi Piace

Sì, la stessa cosa, uno dei pochi avvisi di deprezzamento rimasti per me…

1 Mi Piace