Fakebook テーマ

早とちりしました!上記の返信を投稿した直後に、実際にはこの問題を解決できました。時には、書き出すことで解決策が見えてくることもあります。

更新を行いましたので、現在はテンプレートが一つだけになりました。デフォルトでは topic-list-item.js に以下のようなコードがあります。

  renderTopicListItem() {
    const template = findRawTemplate("list/topic-list-item");
    if (template) {
      this.set("topicListItemContents", template(this).htmlSafe());
    }
  },

つまり、テーマ内で const template をオーバーライドすれば…

  renderTopicListItem() {
    const template = findRawTemplate("list/custom-topic-list-item");
    if (template) {
      this.set("topicListItemContents", template(this).htmlSafe());
    }
  },

これで別のテンプレートを指すようになり、同じ名前のモバイル用の対応テンプレートが存在しないため、モバイル側でもこのテンプレートが使用されるようになります。質問を通じてこの変更のきっかけを作ってくださった @hyd504 さん、ありがとうございます!

「いいね!」 4