1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

EC-CUBEでフロント画面テンプレートを追加

Last updated at Posted at 2017-12-11

EC-CUBEでオリジナルのテンプレートを作成する必要があったので、手順をメモする。
DBはmysqlを接続している。

デフォルトテンプレートをコピーする

.sh
$ cp -r app/template/default/ app/template/[テンプレートコード]/
$ cp -r src/Eccube/Resource/template/default/* app/template/[テンプレートコード]/

[テンプレートコード]は新たに追加するテンプレートを表す適当なコードに置き換える。

テンプレートをDBに登録する

DBサーバーでmysqlクライアントを起動。
phpmyadminを使用する場合は省略。

$ mysql -u [DB_USER] -p
Enter password: [PASSWORD]

mysql > use [DB_NAME];

テンプレートを追加登録するため、以下のコマンドを実行。

.sh
mysql > INSERT INTO `dtb_template` (`device_type_id`, `template_code`, `template_name`, `create_date`, `update_date`) VALUES ('10', '[テンプレートコード]', '[テンプレート名]', NOW(), NOW());

device_type_id

device_type_id 用途
10 PC用テンプレート、レスポンシブデザイン
1 モバイル専用
2 スマホ専用

template_code, template_name

template_codeは先程作成したディレクトリ名に合わせる。
template_nameは任意の文字列。2バイト文字でも可。

確認

管理画面でオーナーズストア->テンプレート->テンプレート一覧から新しいテンプレートが追加されていることを確認できる。
ここから新しいテンプレートを選択すると開発をスタートできる。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?