---
title: "ストアフロントブランドのテーマを拡張しよう"
slug: "extend-the-storefront-branded-theme"
abstract: ""
---
# ストアフロントブランドのテーマを拡張しよう

Sitecore 9.2では、スクリプトがStorefront Brandedテーマから外され、スタイルシートのみが含まれるようになりました。これは、Storefront Brandedテーマのカスタマイズや拡張を容易にし、SXA Storefrontのバージョン間での移行を円滑にするためでした。

文字

概要

browser.js

ブラウザがモバイル版を使っているかどうかを判別します。

新しい場所: /sitecore/Media Library/Base Themes/Commerce Core Theme/Scripts  
  
旧場所: /sitecore/Media Library/Extension Themes/Storefront Branded Extension/Scripts/Common

carousel.js  
  
(以前はコンポーネント-carousel.js)

カルーセルコンポーネントのスライド遷移を担当します。

新しい場所: /sitecore/Media Library/Base Themes/Commerce Components Theme/Scripts/Carousel  
  
旧場所: /sitecore/Media Library/Extension Themes/Storefront Branded Extension/Scripts/Components

catalog-productimage.js  
  
(以前に product-image.js)

製品画像コンポーネントのクリックイベントハンドラを含みます。

新しい場所:  /sitecore/Media Library/Base Themes/Commerce Components Theme/Scripts/Catalog  
  
旧場所: /sitecore/Media Library/Extension Themes/Storefront Branded Extension/scripts/components

catalog-productquantity.js  
  
(以前に add-to-cart.js)

製品数量コンポーネント内のコントロールのイベントハンドラを含みます。

新しい場所:/sitecore/Media Library/Base Themes/Commerce Components Theme/Scripts/Catalog  
  
旧場所: /sitecore/Media Library/Extension Themes/Storefront Branded Extension/Scripts/Components

category-navigation.js

カテゴリナビゲーションコンポーネントのスタイリング変更を処理します。

新しい場所:/sitecore/media library/Base Themes/Commerce Components Theme/Scripts/Navigation  
  
旧場所: /sitecore/Media Library/Extension Themes/Storefront Branded Extension/Scripts/Components

forms.js

すべてのフォームコンポーネントに対してサブミッションおよびAJAXイベントハンドラを含みます。

新しい場所:  /sitecore/Media Library/Base Themes/Commerce Core Theme/Scripts  
  
旧場所: /sitecore/Media Library/Extension Themes/Storefront Branded Extension/Scripts/Common

language-selector.js

言語選択器コンポーネントの表示遷移を処理します。

新しい場所:/sitecore/Media Library/Base Themes/Commerce Components Theme/Scripts/LanguageSelection  
  
旧場所: /sitecore/Media Library/Extension Themes/Storefront Branded Extension/Scripts/Components

product-bundle.js

NA

台本は削除されました。

product-facet-component.js

製品ファセットコンポーネントの初期化関数を含みます。

スクリプトは削除されました。コードは /Project/Storefront/src/Scripts/Commerce/Feature/Catalog/catalog-productfacets.js

search-bar.js

スタイルの変更を処理し、検索バーコンポーネントのクリックイベントハンドラを含みます。

新しい場所:/sitecore/Media Library/Base Themes/Commerce Components Theme/Scripts/SearchBar  
  
旧場所: /sitecore/Media Library/Extension Themes/Storefront Branded Extension/Scripts/components

sub-category-navigation.js  
  
(以前に sub-category-navigation-component.js)

サブカテゴリナビゲーションコンポーネントの表示遷移を処理します。

新しい場所:/sitecore/Media Library/Base Themes/Commerce Components Theme/Scripts/Navigation  
  
旧場所: /sitecore/Media Library/Extension Themes/Storefront Branded Extension/Scripts/Components/

top-bar-links.js  
  
(以前に topbarlinks.js)

上部のバーリンクコンポーネントの表示遷移を処理します。

新しい場所:/sitecore/Media Library/Base Themes/Commerce Components Theme/Scripts/TopBarLinks  
  
旧場所: /sitecore/Media Library/Extension Themes/Storefront Branded Extension/Scripts/Components

> !注コンテンツエディターからすべてのスクリプトにアクセスするには、/sitecore/Media Library/Base Themesフォルダからアクセスできます。

## スクリプトを拡張する

スクリプトを拡張すると:

1.  コンテンツエディターで /sitecore/Media Library/Base Themes/Commerce Components Theme/Scriptsへ行ってください。
2.  拡張したいスクリプトを右クリックして「 **スクリプト、ダウンロード**」をクリックします。
3.  お好きなエディターで必要に応じてスクリプトを修正してください。
4.  コンテンツエディターでスクリプトを選択し、 **コンテンツ** タブの **メディア** セクションで「 **アタッチ** 」をクリックし、保存されているスクリプトの場所に行き「 **アタッチ」**をクリックします。
5.  **メディア**タブで「**保存**」をクリックします。
6.  **「公開**」タブで「**公開**」をクリックして変更を公開します。

## カスタムスクリプトを追加する

カスタムスクリプトを追加するには:

1.  コンテンツエディターで /sitecore/Media Library/Extension Themesへ行ってください。
2.  右クリックで「 **Storefront Branded Extension** 」を選び、「 **挿入」→スクリプト**をクリックします。
3.  **メッセージ**ダイアログボックスで新しいアイテムの名前を入力し、「**OK」**をクリックします。
4.  新しく作成したスクリプトフォルダを選択し、 **フォルダ** タブで「 **ファイルをアップロード**」をクリックします。
5.  「 **ファイルのアップロード** 」ダイアログボックスで「 **ファイル選択** 」をクリックし、カスタムスクリプトが保存されている場所に行き、「 **アップロード**」をクリックします。
6.  **「公開**」タブで「**保存**」をクリックします。
7.  **「公開**」タブで「**公開**」をクリックして変更を公開します。