app/template/default/meta.twig line 1

Open in your IDE?
  1. {#
  2. // ===================================
  3. // 商品詳細
  4. // ===================================
  5. #}
  6. {% if app.request.get('_route') == 'product_detail' or app.request.get('_route') == 'product_detail_slug' %}
  7.     {% set meta_og_type = "og:product" %}
  8.     {% if Product.name != PriorityProduct.name %}
  9.         {% set meta_description = Product.name ~ ' ' ~ PriorityProduct.description_list | default(Product.description_detail) | default(Page.description) %}
  10.     {% else %}
  11.         {% set meta_description = Product.name ~ ' ' ~ Product.description_list | default(Product.description_detail) | default(Page.description) %}
  12.     {% endif %}
  13.     {% set meta_canonical = url('product_detail', {'id': Product.id}) %}
  14.     <meta property="og:title"               content="{{ Product.name }}" />
  15.     <meta property="og:image"               content="{{ absolute_url(asset(PriorityProduct.main_list_image|no_image_product, 'save_image')) }}" />
  16.     <meta property="product:price:amount"   content="{{ Product.getPrice02IncTaxMin }}"/>
  17.     <meta property="product:price:currency" content="{{ eccube_config.currency }}"/>
  18.     <meta property="product:product_link"   content="{{ meta_canonical }}"/>
  19.     <meta property="product:retailer_title" content="{{ BaseInfo.shop_name }}"/>
  20.     {% if not Product.stock_find %}
  21.         <meta name="robots" content="noindex">
  22.     {% endif %}
  23. {#
  24. // ===================================
  25. // 商品一覧
  26. // ===================================
  27. #}
  28. {% elseif app.request.get('_route') == 'product_list' %}
  29.     {% set meta_canonical = url('product_list', {'category_id': Category.id|default(null)}) %}
  30.     {% if pagination|length == 0 %}
  31.         <meta name="robots" content="noindex">
  32.     {% endif %}
  33.     <meta property="og:image" content="/html/images/og_list.png" />
  34. {#
  35. // ===================================
  36. // トップ
  37. // ===================================
  38. #}
  39. {% elseif app.request.get('_route') == 'homepage' %}
  40.     {% set meta_og_type = 'website' %}
  41.     {% set meta_canonical = url('homepage') %}
  42.     <meta property="og:image" content="/html/images/og_list.png" />
  43. {% endif %}
  44. {#
  45. // ===================================
  46. // 共通
  47. // ===================================
  48. #}
  49. <meta property="og:type"      content="{{ meta_og_type|default('article') }}"/>
  50. <meta property="og:site_name" content="{{ BaseInfo.shop_name }}"/>
  51. {% set meta_description = meta_description | default(Page.description) %}
  52. {% if meta_description %}
  53.     <meta name="description"        content="{{ meta_description|striptags|slice(0,120) }}">
  54.     <meta property="og:description" content="{{ meta_description|striptags|slice(0,120) }}"/>
  55. {% endif %}
  56. {% if meta_canonical|default() %}
  57.     <meta property="og:url" content="{{ meta_canonical }}"/>
  58.     <link rel="canonical"   href="{{ meta_canonical }}"/>
  59. {% endif %}