質問 > 管理機能 > 構造化データマークアップ json-ldについて教えてください。 |
管理機能
スレッド表示 | 新しいものから | 前のトピック | 次のトピック | 下へ |
投稿者 | スレッド |
---|---|
ryo-sc |
投稿日時: 2019/2/18 17:22
対応状況: −−−
|
常連 登録日: 2016/2/29 居住地: 投稿: 33 |
構造化データマークアップ json-ldについて教えてください。 ▼テンプレート
[EC-CUBE] EC-CUBEのバージョン2.13.5 position[1]と[3]は取得が出来ています。 しかし[2]のカテゴリーが取得できません。 どのような事象が起こるかというと、下記の商品詳細ページのパンくずリストだとすると、 Top > ラインナップ > 専用パーツ > 自動南京錠 > 自動南京錠2個セット "@type": "ListItem", "position": 2, "item": { "@id": "http://mysite/products/list/category_id=", "name": "ラインナップ > ラインナップ > ラインナップ " } }, { "@type": "ListItem", "position": 3, "item": { "@id": "http://mysite/products/detail/product_id=377", "name": "自動南京錠2個セット" } } ] } となってしまい、[2]が重複されてしまいます。 正規表現としては、下記が正しいのでしょうか。 "@type": "ListItem", "position": 2, "item": { "@id": "http://mysite/products/list/category_id=", "name": "ラインナップ > 専用パーツ > 自動南京錠 " } }, { "@type": "ListItem", "position": 3, "item": { "@id": "http://mysite/products/detail/product_id=377", "name": "自動南京錠2個セット" } } ] } 設定しているタグは下記です。 何卒宜しくお願い致します。 <script type="application/ld+json"> { "@context": "http://schema.org", "@type": "BreadcrumbList", "itemListElement": [ { "@type": "ListItem", "position": 1, "item": { "@id": "<!--{$smarty.const.TOP_URLPATH}-->", "name": "TOP" } }, { "@type": "ListItem", "position": 2, "item": { "@id": "<!--{$smarty.const.HTTP_URL}-->products/list/category_id=<!--{$arrProduct.category_id}-->", "name": "<!--{section name=r loop=$arrRelativeCat}--> <!--{section name=s loop=$arrRelativeCat[r]}--> <!--{$arrRelativeCat[0][0].category_name}--> <!--{if !$smarty.section.s.last}--><!--{$smarty.const.SEPA_CATNAVI}--><!--{/if}--> <!--{/section}--><!--{/section}-->" } }, { "@type": "ListItem", "position": 3, "item": { "@id": "<!--{$smarty.const.HTTP_URL}-->products/detail/product_id=<!--{$arrProduct.product_id}-->", "name": "<!--{$arrProduct.name|h}-->" } } ] } </script> |
468 |
投稿日時: 2019/2/19 10:47
対応状況: −−−
|
神 登録日: 2008/10/26 居住地: 投稿: 3217 |
Re: 構造化データマークアップ json-ldについて教えてください。 カテゴリ名を出力している以下の記述では、
配列$arrRelativeCatのインデックスが常に0になっていますので、 ループしても常に同じ内容が出力されると思います。 <!--{$arrRelativeCat[0][0].category_name}-->
|
ryo-sc |
投稿日時: 2019/3/4 14:36
対応状況: 解決済
|
常連 登録日: 2016/2/29 居住地: 投稿: 33 |
Re: 構造化データマークアップ json-ldについて教えてください。 ありがとうございます
反映できました。 |
jimcorbett |
投稿日時: 2019/3/5 14:02
対応状況: −−−
|
新米 登録日: 2019/1/7 居住地: 投稿: 3 |
Re: 構造化データマークアップ json-ldについて教えてください。 There are online generator too for Structured markup of the website that you can use. it is very simple to create structured markup through these tools
|
スレッド表示 | 新しいものから | 前のトピック | 次のトピック | トップ |