Suite | Growth、Professional、EnterpriseまたはEnterprise Plus |
Support | + Guide ProfessionalまたはEnterprise |
GuideのテンプレートV2では、標準的なJavaScriptの代わりにjQuer文をテーマで使用したい場合、jQueryライブラリをインポートする必要があります。
このガイダンスは説明のみを目的としており、jQueryに関する問題がある場合は、jQueryの公式サイトを参照してください。
ヘルプセンターテーマのjQueryをインストールまたはアップグレードするには
- ナレッジベース管理者で、サイドバーにあるデザインのカスタマイズ(
)をクリックします。
- 変更したいテーマを開き、「カスタマイズ」をクリックします。
- 「コードを編集」をクリックします。
- 「document_head.hbs」をクリックします。
- https://code.jquery.comにアクセスし、使用したいjQueryのminified版をクリックします。
-
script
タグをHTMLファイルに貼り付けます。以下に例を示します。<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"> </script>
integrity
の値は変わります。この属性は、サードパーティのサーバーでホストされているリソースが改竄されていないことをブラウザに知らせます。
jQueryライブラリが読み込まれ、jQuery文をヘルプセンターのテーマに組み込めるようになります。
2件のコメント
Christopher Kennedy
Hi Bradley,
You can use the version of jQuery that you'd like in your theme. That portion is totally within your control. Also, this article demonstrates loading jQuery from the document_head.hbs template. This template renders on all Help Center pages, so no need to duplicate that effort elsewhere.
Thanks,
0
Brad Allen
Two questions related to this.
1 - what version of jquery must be installed to use this code?
2 - does this just need to be added to the script.js file in templates or do i need some HTML in my new requests template as well?
0
サインインしてコメントを残します。