バージョン選択

フォーラム

メニュー

オンライン状況

77 人のユーザが現在オンラインです。 (69 人のユーザが フォーラム を参照しています。)
登録ユーザ: 0
ゲスト: 77
もっと...

サイト内検索

質問 > その他 > default_frame.twigの編集

その他

新規スレッドを追加する

スレッド表示 | 新しいものから 前のトピック | 次のトピック | 下へ
投稿者 スレッド
ax1701
投稿日時: 2019/4/24 15:55
対応状況: 確認中
一人前
登録日: 2018/6/11
居住地:
投稿: 95
Re: default_frame.twigの編集
product.freearea は1行目も2行目も全く同じですが。?。
umebius
投稿日時: 2019/4/24 15:56
対応状況: −−−
登録日: 2016/7/22
居住地:
投稿: 2085
Re: default_frame.twigの編集
わかりにくくてすみません、
Pが大文字(Upper case)です。
ax1701
投稿日時: 2019/4/24 15:58
対応状況: 確認中
一人前
登録日: 2018/6/11
居住地:
投稿: 95
Re: default_frame.twigの編集
すみません。
2行目の P は大文字だったのですね。
やってみます。
umebius
投稿日時: 2019/4/24 16:02
対応状況: −−−
登録日: 2016/7/22
居住地:
投稿: 2085
Re: default_frame.twigの編集
そうです、2行目の P が大文字です。

商品詳細ページで使えるのは 大文字のProductかと思います。
ax1701
投稿日時: 2019/4/24 16:14
対応状況: 確認中
一人前
登録日: 2018/6/11
居住地:
投稿: 95
Re: default_frame.twigの編集
umebius様 ご回答ありがとうございます。
おっしゃるように 大文字の P にしてやってみましたが、
エラーになります。

最初に修正した文で抜けがありましたので改めて書きます。
おおもとの抜粋。

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 %}

カットした部分

5 {% if PageLayout.description is not empty %}
<meta name="description" content="{{ PageLayout.description }}">
6 {% endif %}

追記部分 4行目の下に

{% elseif PageLayout.url == "product_detail" %}
<meta name="description" content="{{ include(template_form_string(Product.freearea)) }}">
{% else %}
<meta name="description" content="{{ PageLayout.description }}">
{% endif %}
umebius
投稿日時: 2019/4/24 16:28
対応状況: −−−
登録日: 2016/7/22
居住地:
投稿: 2085
Re: default_frame.twigの編集
{% elseif PageLayout.url
のところですが、
elseif ではなく、 if ではないでしょうか?

{% if PageLayout.url
umebius
投稿日時: 2019/4/24 16:35
対応状況: −−−
登録日: 2016/7/22
居住地:
投稿: 2085
Re: default_frame.twigの編集
おそらく下のようになるのが完成系ではないでしょうか?


<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>
{% if PageLayout.author is not empty %}
<meta name="author" content="{{ PageLayout.author }}">
{% endif %}
{% if PageLayout.url == "product_detail" %}
   <meta name="description" content="{{ include(template_from_string(Product.freearea)) }}">
{% else %}
   <meta name="description" content="{{ PageLayout.description }}">
{% endif %}
{% if PageLayout.keyword is not empty %}
<meta name="keywords" content="{{ PageLayout.keyword }}">
{% endif %}
{% if PageLayout.meta_robots is not empty %}
<meta name="robots" content="{{ PageLayout.meta_robots }}">
{% endif %}


・template_form_stringはtemplate_from_stringに直す
・productは大文字のProductに直す
・elseifをifに直す
ax1701
投稿日時: 2019/4/24 16:51
対応状況: 開発中
一人前
登録日: 2018/6/11
居住地:
投稿: 95
Re: default_frame.twigの編集
umebius様

ありがとうございます。

良く拝見した上で今晩 やってみますね。
umebius
投稿日時: 2019/4/24 18:31
対応状況: −−−
登録日: 2016/7/22
居住地:
投稿: 2085
Re: default_frame.twigの編集
そうですね、何かありましたらご投稿ください。

解決しないようならログを確認するか、index_dev.phpを使ったデバッグモードにした方が良いかもしれません
ax1701
投稿日時: 2019/4/24 18:34
対応状況: 解決済
一人前
登録日: 2018/6/11
居住地:
投稿: 95
Re: default_frame.twigの編集
umebius様

ありがとうございます。

フリーエリアの文章が
<meta name="description" content="----">の
ーーーに入るようになりました。

全く無知な私に教えて戴いてありがとうございました。
« 1 (2) 3 »
スレッド表示 | 新しいものから 前のトピック | 次のトピック | トップ


 



ログイン


EC-CUBE公式 Amazon Payプラグイン

統計情報

総メンバー数は88,300名です
総投稿数は109,692件です

投稿数ランキング

1
seasoft
7365
2
468
3217
3
AMUAMU
2712
4
nanasess
2303
5
umebius
2085
6
yuh
1818
7
h_tanaka
1610
8
red
1568
9
mcontact
1240
10
tsuji
958
11
fukap
907
12
shutta
835
13
tao_s
796
14 ramrun 789
15 karin 689
16 sumida 641
17
homan
633
18 DELIGHT 572
19
patapata
502
20
flealog
485


ネットショップの壺

EC-CUBEインテグレートパートナー

Copyright© EC-CUBE CO.,LTD. All Rights Reserved.