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 „Gefällt mir“

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 „Gefällt mir“

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

1 „Gefällt mir“

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 „Gefällt mir“

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

1 „Gefällt mir“

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 „Gefällt mir“

Nice one! thanks @tshenry :heart:

1 „Gefällt mir“

Gibt es einen Grund, dein Skript nicht mit dem folgenden Code in Anpassen → Themes → Mobile → Header zu kombinieren?

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

Dadurch wird die initiale Weiterleitung zu /latest übernommen, falls der Nutzer auf der Startseite ankommt.

1 „Gefällt mir“

Kein besonderer Grund, nein. Das heißt, ich verwende dieses Skript nicht mehr. Durch die Einführung von benutzerdefinierten Startseiten lasse ich diejenigen, die /latest bevorzugen, diese auswählen.

1 „Gefällt mir“

Ich habe dieses Thema ursprünglich gefunden, als ich nach einer Lösung für mein Problem gesucht habe:

Wie dort erklärt, habe ich mein Forum so eingerichtet, dass es Kategorien + Neueste anzeigt, da ich nicht nur die Neuesten auf dem Desktop anzeigen möchte. Hier sind die beiden Discourse-Einstellungen, die dieses Layout ermöglichen:

Es ist das ideale Layout für mich, da es sowohl Kategorien für Benutzer anzeigt, die etwas Neues veröffentlichen möchten, als auch die Neuesten für andere Benutzer, die einfach nur zurückkommen, um zu sehen, was neu ist.

Für alle, die das Gleiche tun möchten, hier ist, was Sie tun müssen:

  1. Gehen Sie zum Abschnitt CSS/HTML bearbeiten Ihres Themas:

  2. Fügen Sie das folgende Skript im Abschnitt MobilKopfzeile hinzu (damit es nur Besucher auf mobilen Geräten betrifft):

    Hier ist das Skript, damit Sie es kopieren/einfügen können:

    <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>
    

Update: Die oben verlinkte Theme-Komponente Forced Mobile Homepage ist wahrscheinlich ein besserer Weg, dies zu erreichen.

10 „Gefällt mir“

Wäre es möglich, diese Funktion pro Benutzer einzurichten? Zum Beispiel könnte jeder Benutzer seine Standardseite auf Mobilgeräten in den Interface-Einstellungen auswählen (es gibt bereits eine allgemeine Option, wir bräuchten nur eine für Mobilgeräte).

3 „Gefällt mir“

Ich habe derzeit dasselbe Problem: Auf dem Desktop bevorzuge ich die Kategorienansicht, in der das neueste Thema auf der rechten Seite angezeigt wird. Auf dem Mobilgerät zeigt die Kategorienansicht nur die Kategorien an. Auf dem Mobilgerät würde ich die Ansicht „Letzte Themenänderungen“ bevorzugen.

Es wäre toll, zwei Einstellungen zu haben:

  • Standard-Startseite auf dem Desktop: [Auswahlfeld]
  • Standard-Startseite auf dem Mobilgerät: [Auswahlfeld]

Ist dies etwas, wofür ein PR angenommen würde?

7 „Gefällt mir“

Könnte dies auch eine gerätespezifische Einstellung sein? Die oben genannten Workarounds sind nicht ideal, da sie die Einstellung für alle mobilen Nutzer erzwingen (und Tablets sind in dieser Hinsicht schwer zu kategorisieren). Es liegt zudem auf der Hand, dass es oft sinnvoll sein kann, unterschiedliche Präferenzen je nach Gerät zu haben, nicht nur die Unterscheidung zwischen Desktop und Mobilgerät.

1 „Gefällt mir“

Das ist das Beste seit dem Rad! Danke, Bruder

1 „Gefällt mir“

Ich hätte diese Einstellungen auch gerne… Gibt es eine Möglichkeit, das zu tun?