app/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_description = meta_description ~ Page.description %}
  5.     {% set meta_canonical = url('product_detail', {'id': Product.id}) %}
  6.     <meta property="og:title" content="{{ Product.name }}" />
  7.     <meta property="og:image" content="{{ absolute_url(asset(Product.main_list_image|no_image_product, 'save_image')) }}" />
  8.     <meta property="product:price:amount" content="{{ Product.getPrice02IncTaxMin }}"/>
  9.     <meta property="product:price:currency" content="{{ eccube_config.currency }}"/>
  10.     <meta property="product:product_link" content="{{ url('product_detail', {'id': Product.id}) }}"/>
  11.     <meta property="product:retailer_title" content="{{ BaseInfo.shop_name }}"/>
  12.     {% if not Product.stock_find %}
  13.         <meta name="robots" content="noindex">
  14.     {% endif %}
  15. {% elseif app.request.get('_route') == 'product_list' %}
  16.     {% set meta_description = Category.name|default('カンザキ千里店') ~ 'の取扱商品一覧です。' ~ Page.description %}
  17.     {% set meta_canonical = url('product_list', {'category_id': Category.id|default(null)}) %}
  18.     {% if pagination|length == 0 %}
  19.         <meta name="robots" content="noindex">
  20.     {% endif %}
  21. {% elseif app.request.get('_route') == 'homepage' %}
  22.     {% set meta_og_type = 'website' %}
  23.     {% set meta_canonical = url('homepage') %}
  24. {% elseif Page is defined and Page.edit_type == 0 and Page.url is defined %}
  25.     {% set meta_canonical = url(eccube_config.eccube_user_data_route, {'route': Page.url}) %}
  26. {% endif %}
  27. <meta property="og:type" content="{{ meta_og_type|default('article') }}"/>
  28. <meta property="og:site_name" content="{{ BaseInfo.shop_name }}"/>
  29. {% set meta_description = meta_description | default(Page.description) %}
  30. {% if meta_description %}
  31.     <meta name="description" content="{{ meta_description|striptags|slice(0,120) }}">
  32.     <meta property="og:description" content="{{ meta_description|striptags|slice(0,120) }}"/>
  33. {% endif %}
  34. {% if meta_canonical|default() %}
  35.     {# canonical url #}
  36.     {# Product list #}
  37.     {% if Category is defined and Category %}
  38.         {% if pagination is defined and pagination.paginationData is defined and pagination.paginationData.pageCount > 1 %}
  39.             {# 最初のページ #}
  40.             {% if pagination.paginationData.current == 1  %}
  41.             <meta property="og:url" content="{{ meta_canonical }}"/>
  42.             <link rel="next" href="{{ meta_canonical }}&pageno=2" title="{{ Category.name }} {{ '%pageno%ページ目'|trans({ '%pageno%': 2 }) }}">
  43.             <link rel="canonical" href="{{ meta_canonical }}" />
  44.             {# 最後のページ #}
  45.             {% elseif pagination.paginationData.last == pagination.paginationData.current %}
  46.             <meta property="og:url" content="{{ meta_canonical }}&pageno={{ pagination.paginationData.last }}"/>
  47.             <link rel="prev" href="{{ meta_canonical }}&pageno={{ pagination.paginationData.previous }}" title="{{ Category.name }} {{ '%pageno%ページ目'|trans({ '%pageno%': pagination.paginationData.previous }) }}">
  48.             <link rel="canonical" href="{{ meta_canonical }}&pageno={{ pagination.paginationData.last }}" />
  49.             {# 途中のページ #}
  50.             {% else %}
  51.             <meta property="og:url" content="{{ meta_canonical }}&pageno={{ pagination.paginationData.current }}"/>
  52.             <link rel="next" href="{{ meta_canonical }}&pageno={{ pagination.paginationData.next }}" title="{{ Category.name }} {{ '%pageno%ページ目'|trans({ '%pageno%': pagination.paginationData.next }) }}">
  53.             <link rel="prev" href="{{ meta_canonical }}&pageno={{ pagination.paginationData.previous }}" title="{{ Category.name }} {{ '%pageno%ページ目'|trans({ '%pageno%': pagination.paginationData.previous }) }}">
  54.             <link rel="canonical" href="{{ meta_canonical }}&pageno={{ pagination.paginationData.current }}" />
  55.             {% endif %}
  56.         {% else %}
  57.         {# ページング無し #}
  58.         <meta property="og:url" content="{{ meta_canonical }}"/>
  59.         <link rel="canonical" href="{{ meta_canonical }}" />
  60.         {% endif %}
  61.     {# Other #}
  62.     {% else %}
  63.     <meta property="og:url" content="{{ meta_canonical }}"/>
  64.     <link rel="canonical" href="{{ meta_canonical }}" />
  65.     {% endif %}
  66. {% endif %}