src/Eccube/Resource/template/default/meta.twig line 1

Open in your IDE?
  1. {% if app.request.get('_route') == 'product_detail' %}
  2.     {% set meta_og_type = "og:product" %}
  3.     {% set meta_description = Product.description_list | default(Product.description_detail) | default(Page.description) %}
  4.     {% set meta_canonical = url('product_detail', {'id': Product.id}) %}
  5.     <meta property="og:title" content="{{ Product.name }}" />
  6.     <meta property="og:image" content="{{ absolute_url(asset(Product.main_list_image|no_image_product, 'save_image')) }}" />
  7.     <meta property="product:price:amount" content="{{ Product.getPrice02IncTaxMin }}"/>
  8.     <meta property="product:price:currency" content="{{ eccube_config.currency }}"/>
  9.     <meta property="product:product_link" content="{{ url('product_detail', {'id': Product.id}) }}"/>
  10.     <meta property="product:retailer_title" content="{{ BaseInfo.shop_name }}"/>
  11.     {% if not Product.stock_find %}
  12.         <meta name="robots" content="noindex">
  13.     {% endif %}
  14. {% elseif app.request.get('_route') == 'product_list' %}
  15.     {% set meta_canonical = url('product_list', {'category_id': Category.id|default(null)}) %}
  16.     {% if pagination|length == 0 %}
  17.         <meta name="robots" content="noindex">
  18.     {% endif %}
  19. {% elseif app.request.get('_route') == 'homepage' %}
  20.     {% set meta_og_type = 'website' %}
  21.     {% set meta_canonical = url('homepage') %}
  22. {% endif %}
  23. <meta property="og:type" content="{{ meta_og_type|default('article') }}"/>
  24. <meta property="og:site_name" content="{{ BaseInfo.shop_name }}"/>
  25. {% set meta_description = meta_description | default(Page.description) %}
  26. {% if meta_description %}
  27.     <meta name="description" content="{{ meta_description|striptags|slice(0,120) }}">
  28.     <meta property="og:description" content="{{ meta_description|striptags|slice(0,120) }}"/>
  29. {% endif %}
  30. {% if meta_canonical|default() %}
  31.     <meta property="og:url" content="{{ meta_canonical }}"/>
  32.     <link rel="canonical" href="{{ meta_canonical }}"/>
  33. {% endif %}