質問 > その他 > default_frame.twigの編集 |
その他
スレッド表示 | 新しいものから | 前のトピック | 次のトピック | 下へ |
投稿者 | スレッド |
---|---|
ax1701 |
投稿日時: 2019/4/16 13:49
対応状況: 確認中
|
一人前 登録日: 2018/6/11 居住地: 投稿: 95 |
default_frame.twigの編集 [EC-CUBE] 3.0.16、新規インストール
[レンタルサーバ] さくら共用プレミアム [OS] FreeBSD [PHP] PHP 7.1.17 [データベース] MySQL 5.7 [WEBサーバ] Apache 2.4系 [ブラウザ] IE 11.0.65 [導入プラグインの有無] 無効化中 [カスタマイズの有無] 某社 2カラムデザインテンプレート使用中 現在運用してます。 質問内容 SEO対策で商品ごとのページのフリーエリアの文章をdiscription に設定したいと考えています。 コンテンツ管理ー商品詳細ページでは共通設定しか出来ないからです。現在の設定で<title>は問題ありません。 以下のファイルを改良すればよいのでしょうか? またやり方は記述のような方法で良いのでしょうか? 追加・修正した部分は行番号を入れていません。 このような事をするのは初めてですので教えて戴けないでしょうか? app/template/sxxxx(購入したデザインテンプレートのフォルダ名)/default_frame.twig 現状 1 <title>{% if subtitle is defined and subtitle is not empty %}{{ subtitle }} / {% elseif title is defined and title is not empty %}{{ title }} / {% endif %}{{ BaseInfo.shop_name }}</title> 2 {% if PageLayout.author is not empty %} 3 <meta name="author" content="{{ PageLayout.author }}"> 4 {% endif %} 5 {% if PageLayout.description is not empty %} 6 <meta name="description" content="{{ PageLayout.description }}"> 7 {% endif %} 8 {% if PageLayout.keyword is not empty %} 9 <meta name="keywords" content="{{ PageLayout.keyword }}"> 10 {% endif %} 11 {% if PageLayout.meta_robots is not empty %} 12 <meta name="robots" content="{{ PageLayout.meta_robots }}"> 13 {% endif %} 修正 1 <title>{% if subtitle is defined and subtitle is not empty %}{{ subtitle }} / {% elseif title is defined and title is not empty %}{{ title }} / {% endif %}{{ BaseInfo.shop_name }}</title> 2 {% if PageLayout.author is not empty %} 3 <meta name="author" content="{{ PageLayout.author }}"> {% elseif PageLayout.url == "product_detail" %} <meta name="description" content="{{ include(template_form_string(product.freearea)) }}"> {% else %} <meta name="description" content="{{ PageLayout.description }}"> {% endif %} 8 {% if PageLayout.keyword is not empty %} 9 <meta name="keywords" content="{{ PageLayout.keyword }}"> 10 {% endif %} 11 {% if PageLayout.meta_robots is not empty %} 12 <meta name="robots" content="{{ PageLayout.meta_robots }}"> 13 {% endif %} |
468 |
投稿日時: 2019/4/18 10:36
対応状況: −−−
|
神 登録日: 2008/10/26 居住地: 投稿: 3217 |
Re: default_frame.twigの編集 twigの書き方まで合っているかどうか確認できていませんが、
変更するファイルは間違いないと思います。 if文の判定も特に問題無いのではないかと思います。
|
ax1701 |
投稿日時: 2019/4/22 20:11
対応状況: 確認中
|
一人前 登録日: 2018/6/11 居住地: 投稿: 95 |
Re: default_frame.twigの編集 ご回答をありがとうございます。
試してみます。 ・・内容を編集し、ファイルをアップロードするとエラーになりました。他に行うことなどがあったのでしょうか? |
ax1701 |
投稿日時: 2019/4/24 13:37
対応状況: 確認中
|
一人前 登録日: 2018/6/11 居住地: 投稿: 95 |
Re: default_frame.twigの編集 default_frame.twig の内容を変更をしてアップロードして上書きすると、商品詳細ページがエラーになります。
変更の記載が間違っているのでしょうか? |
umebius |
投稿日時: 2019/4/24 14:25
対応状況: −−−
|
神 登録日: 2016/7/22 居住地: 投稿: 2085 |
Re: default_frame.twigの編集 template_form_stringではなく、
template_from_string ではないでしょうか?
|
ax1701 |
投稿日時: 2019/4/24 15:22
対応状況: 開発中
|
一人前 登録日: 2018/6/11 居住地: 投稿: 95 |
Re: default_frame.twigの編集 お答えありがとうございます。
template_form_stringではなく、 template_from_string との事。 試してみます。 |
ax1701 |
投稿日時: 2019/4/24 15:45
対応状況: 確認中
|
一人前 登録日: 2018/6/11 居住地: 投稿: 95 |
Re: default_frame.twigの編集 form を from に変更しましたが、やはりシステムエラーになりました。
|
umebius |
投稿日時: 2019/4/24 15:48
対応状況: −−−
|
神 登録日: 2016/7/22 居住地: 投稿: 2085 |
Re: default_frame.twigの編集 管理画面からキャッシュを消しても同じですか?
|
ax1701 |
投稿日時: 2019/4/24 15:50
対応状況: 確認中
|
一人前 登録日: 2018/6/11 居住地: 投稿: 95 |
Re: default_frame.twigの編集 はい、twigを変更し、アップするたびにキャッシュを消しています。
|
umebius |
投稿日時: 2019/4/24 15:51
対応状況: −−−
|
神 登録日: 2016/7/22 居住地: 投稿: 2085 |
Re: default_frame.twigの編集 product.freearea ではなく、
Product.freearea にするとどうでしょうか?
|
(1) 2 3 » |
スレッド表示 | 新しいものから | 前のトピック | 次のトピック | トップ |