Different landing page for desktop vs mobile theme?

No worries. I should have linked to instructions here too! There is a nice illustrated set of instructions you can check out here. It’s possible you might be on the latest version of Discourse, in which case the UX for themes and components has changed a little. Let me know if the instructions I linked to still leave you a little lost. I’d be happy to help you figure it out.

By the way, the topic below is the home of this theme component now:

2 Mi Piace

thanks @tshenry i’ll take a look.

however I’ve just fiddled round with the customization settings - I’ve never had an issue before, and now my site has disappeared!! Just produces a blank screen, but the code is there!!

any idea how to reverse changes from the cli???

cheers

You’ll need to go to your site’s safe mode Air Cadet Central and check “disable current theme” then you’ll want to revert whatever change you made in the customizations.

2 Mi Piace

thanks fella - didn’t know that existed! Lifesaver!

1 Mi Piace

OK back up and working - thanks again - I’ve installed your theme and it’s installing as a Theme not a Theme Component??? any ideas. I’m on Version: v2.1.0.beta5 +66

cheers, and thanks for your hard work :smiley:

No problem. If you select it from the list of themes, then scroll down, you should see a section like this:

You’ll want to click the “make component” button then confirm. You should then be able to add it to your main theme the way it’s outlined in the instructions I linked to earlier.

Fab, getting there! Making it a component works, but when I add it to my theme it adds a component with the others but there’s no text for the link, but the (x) button is there. The link it produces ends in a # where the others don’t??
and it doesn’t seem to work!!

Cheers

Ah yeah, I think that might be a little bug that’s still getting worked out. Try refreshing the page, then click the (x) if that blank theme component is still there, then try selecting the Force Mobile Homepage component again. You might also try selecting another theme component from the dropdown list, then open the list again and select the Force Mobile Homepage component again. Click the “add” button and hopefully that should do it!

3 Mi Piace

You are indeed a hero - now working as advertised! Many thanks for your help today, greatly appreciated!

1 Mi Piace

Yes, I’ve come across this several times. Has this been reported I wonder?

I don’t know - I haven’t - but @tshenry 's suggestion of moving in and out of the drop down menu after a page reload worked.

1 Mi Piace

Nice one! thanks @tshenry :heart:

1 Mi Piace

C’è qualche motivo per non combinare il tuo script con quanto segue in Personalizza → Temi → Mobile → Intestazione?

<script>
  if (window.location.pathname == "/")
  {   window.location.href = "/latest";
  }
</script>

Questo gestirà il reindirizzamento iniziale a /latest se l’utente arriva sulla home page.

1 Mi Piace

Nessun motivo particolare, no. Detto questo, non uso più quello script. Con l’aggiunta delle pagine iniziali selezionabili dall’utente, ho solo quelli che preferiscono /latest che la selezionano.

1 Mi Piace

Ho trovato questo argomento inizialmente cercando una soluzione al mio problema:

Come spiega, ho configurato il mio forum per visualizzare le categorie + gli ultimi post, poiché non desidero mostrare solo gli ultimi post su desktop. Ecco le due impostazioni di Discourse che rendono possibile questo layout:

È il layout ideale per me, poiché mostra sia le categorie per gli utenti che desiderano pubblicare qualcosa di nuovo, sia gli ultimi post disponibili per chi torna semplicemente per vedere le novità.

Per chiunque legga e desideri fare lo stesso, ecco cosa è necessario fare:

  1. Vai alla sezione Modifica CSS/HTML del tuo tema:

  2. Aggiungi lo script seguente nella sezione MobileIntestazione (in modo che influisca solo sui visitatori su dispositivi mobili):

    Ecco lo script così da poterlo copiare/incollare:

    <script>
        if (window.location.pathname == "/")
        {   window.location.href = "/latest";
        }
    </script>
    
    <script type="text/discourse-plugin" version="0.4">
        api.changeWidgetSetting('home-logo', 'href', '/latest')
    </script>
    

Aggiornamento: Il componente del tema Pagina iniziale mobile forzata collegato sopra è probabilmente un modo migliore per ottenere questo risultato.

10 Mi Piace

Sarebbe possibile implementare questa funzionalità su base per utente? Ad esempio, ogni utente potrebbe scegliere la propria pagina predefinita per dispositivi mobili nelle preferenze dell’interfaccia (esiste già un’impostazione generale, ci servirebbe solo una specifica per i soli dispositivi mobili).

3 Mi Piace

Attualmente sto riscontrando lo stesso problema: su desktop preferisco la vista delle categorie in cui l’ultimo argomento appare a destra. Su mobile, la vista delle categorie mostra solo le categorie. Su mobile preferirei avere la vista “ultimi” aggiornamenti degli argomenti.

Sarebbe fantastico avere due preferenze:

  • pagina iniziale predefinita su desktop: [campo di selezione]
  • pagina iniziale predefinita su mobile: [campo di selezione]

È qualcosa per cui verrebbe accettata una PR?

7 Mi Piace

Potrebbe anche essere un’impostazione per dispositivo? I workaround pubblicati sopra non sono ideali perché impongono l’impostazione a tutti gli utenti mobili (e i tablet sono difficili da classificare in questo senso). Inoltre, è piuttosto evidente che spesso abbia senso avere preferenze diverse in base al dispositivo, non solo alla distinzione tra desktop e mobile.

1 Mi Piace

Questa è la cosa migliore dopo la ruota! Grazie fratello

1 Mi Piace

Mi piacerebbe avere anche queste preferenze… C’è un modo per farlo?