サービスポータルの各ナレッジ記事に固有のアイコン/画像を表示する方法Summary<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } ユースケースは、各ナレッジ記事に一意のアイコンを提供し、それをサービスポータルに表示することです。 このソリューションにはカスタマイズが含まれ、プラットフォームの顧客/所有者の責任となります。**** Release<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } これはニューヨークで開発され、テストされています。 ただし、変更は多かれ少なかれバージョンに依存しません。 Instructions<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } これを実現するための手順: ナレッジベース: これを含めるナレッジベースを選択します。詳細に移動し、[アイコン] フィールドの [更新] をクリックします。ナレッジベースの画像を選択して保存します。ナレッジベースにはアイコンが添付されている必要があります。 ナレッジ記事: kb_knowledgeテーブルに移動します。テーブルに IMAGE (ラベル - アイコン) タイプの新しい列を作成して保存します。記事を作成し、その記事のポータルに表示する画像を提供し、記事を保存します。 ウィジェットインスタンス: ポータルの kb_search ページに移動します。 ページのナレッジ結果のインスタンスに移動します。(https://instance.service-now.com/sp_instance.do%3Fsys_id%3Dfe379905db30320099f93691f0b8f571)[他のオプション] の [ knowledge_fields ] セクションを次のように変更します。 "knowledge_fields": {"value": "author,sys_view_count,rating,u_icon","displayValue": "author,sys_view_count,rating,u_icon" }, 角度テンプレート: sp_ng_templateテーブルで kb_result_article_summary テンプレートを探します。(https://インスタンス.service-now.com/sp_ng_template.do?sys_id=1c873ab1db12220099f93691f0b8f5c1) 記事の画像を表示するセクションを変更します。 <img ng-if="article.meta.knowledgeBaseIcon" alt="" class="kb-icon" ng-src="{{article.meta.knowledgeBaseIcon}}"> to <img ng-if="article.meta.knowledgeBaseIcon" alt="" class="kb-icon" ng-src="{{article.meta.u_icon.display_value}}"> 3.コード <span ng-if="f != 'u_icon'"> を <ng-switch-default> セクションの上に追加し、画像名がポータルに表示されないようにします。4.適切に閉じて、完全なスイッチが新しい IF 内にあることを確認します。 <span ng-if="f != 'u_icon'"><span ng-switch-default="" ng-switch="article.meta[f].type"><span ng-if="!$first" class="dot" aria-hidden="true"> • </span><span class="secondary-label hidden-sm hidden-xs" ng-if="c.options.show_secondary_fields_label">{{::article.meta[f].label}} : </span><span ng-switch-when="glide_date"><sn-time-ago timestamp="::article.meta[f].value" /></span><span ng-switch-when="glide_date_time"><sn-time-ago timestamp="::article.meta[f].value" /></span><span ng-switch-default="">{{article.meta[f].display_value}} </span></span></span> プロパティ: ログインの必要なくポータルでアイコンをレンダリングする場合は、以下のプロパティを有効にします。 glide.image_provider.security_enabled