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

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

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

「いいね!」 1

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

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

「いいね!」 1

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

Nice one! thanks @tshenry :heart:

「いいね!」 1

カスタマイズ → テーマ → モバイル → ヘッダーの以下のスクリプトと、あなたのスクリプトを結合しない理由はありますか?

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

これにより、ユーザーがホームページにアクセスした際に /latest への初期リダイレクトを処理できます。

「いいね!」 1

特に理由はありません。ただ、私はそのスクリプトはもう使っていません。ユーザーが選択できるホームページの追加により、/latest を選択する人はそれを選べるようにしました。

「いいね!」 1

私は当初、自分の問題の解決策を探していた際にこのトピックを見つけました:

説明されている通り、デスクトップでは最新の投稿のみを表示したくないため、カテゴリと最新投稿を表示するようにフォーラムを設定しています。このレイアウトを実現する 2 つの Discourse 設定は以下の通りです:

このレイアウトは、新しい投稿を投稿したいユーザーにはカテゴリを表示し、単に最新情報を見に来た他の人々には最新投稿を表示するため、私にとって理想的です。

同じことをしたいと読んでいる方のために、必要な手順を以下に示します:

  1. テーマの CSS/HTML の編集 セクションに移動します:

  2. 次のスクリプトを モバイルヘッダー セクションに追加します(これにより、モバイルデバイスの訪問者のみに影響します):

    コピー&ペースト用のスクリプトは以下の通りです:

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

更新: 上記の 強制モバイルホームページ テーマコンポーネントを使用する方が、おそらくこのタスクを達成するより良い方法です。

「いいね!」 10

この機能をユーザーごとに設定することは可能でしょうか?例えば、各ユーザーがモバイル向けのインターフェース設定でデフォルトページを選択できるようにするものです(すでに一般的な設定はありますが、モバイル専用のもう一つを追加する必要があります)。

「いいね!」 3

私も現在、同じ問題に直面しています。デスクトップでは、右側に最新トピックが表示されるカテゴリ表示を好みます。モバイルでは、カテゴリ表示ではカテゴリのみが表示されます。モバイルでは「最新」トピックの変更表示を希望しています。

以下の2つの設定があると素晴らしいです。

  • デスクトップのデフォルトホーム画面:[選択フィールド]
  • モバイルのデフォルトホーム画面:[選択フィールド]

これに対してプルリクエスト(PR)は受け入れられますか?

「いいね!」 7

これはデバイスごとの設定としても可能でしょうか?上記の回避策は、すべてのモバイルユーザーに設定を強制してしまい(この点でタブレットの分類も難しいため)、理想的ではありません。また、デスクトップとモバイルの区別だけでなく、デバイスに基づいて異なる設定が必要になる場合がしばしばあることは明らかです。

「いいね!」 1

これは車輪の次に最高のものだ!ありがとう、ブラザー

「いいね!」 1

私もこれらの設定をしたいのですが…何か方法はありますか?