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_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. {% elseif Page is defined and Page.edit_type == 0 and Page.url is defined %}
  23.     {% set meta_canonical = url(eccube_config.eccube_user_data_route, {'route': Page.url}) %}
  24. {% endif %}
  25. {% if app.request.host == 'stg.itsukushi-store.com' %}
  26.     <meta name="robots" content="noindex,nofollow">
  27. {% endif %}
  28. <meta property="og:type" content="{{ meta_og_type|default('article') }}"/>
  29. <meta property="og:site_name" content="{{ BaseInfo.shop_name }}"/>
  30. {% set meta_description = meta_description | default(Page.description) %}
  31. {% if meta_description %}
  32.     <meta name="description" content="{{ meta_description|striptags|slice(0,120) }}">
  33.     <meta property="og:description" content="{{ meta_description|striptags|slice(0,120) }}"/>
  34. {% endif %}
  35. {% if meta_canonical|default() %}
  36.     {# canonical url #}
  37.     {# Product list #}
  38.     {% if Category is defined and Category %}
  39.         {% if pagination is defined and pagination.paginationData is defined and pagination.paginationData.pageCount > 1 %}
  40.             {# 最初のページ #}
  41.             {% if pagination.paginationData.current == 1  %}
  42.             <meta property="og:url" content="{{ meta_canonical }}"/>
  43.             <link rel="next" href="{{ meta_canonical }}&pageno=2" title="{{ Category.name }} {{ 'front.product.pageno'|trans({ '%pageno%': 2 }) }}">
  44.             <link rel="canonical" href="{{ meta_canonical }}" />
  45.             {# 最後のページ #}
  46.             {% elseif pagination.paginationData.last == pagination.paginationData.current %}
  47.             <meta property="og:url" content="{{ meta_canonical }}&pageno={{ pagination.paginationData.last }}"/>
  48.             <link rel="prev" href="{{ meta_canonical }}&pageno={{ pagination.paginationData.previous }}" title="{{ Category.name }} {{ 'front.product.pageno'|trans({ '%pageno%': pagination.paginationData.previous }) }}">
  49.             <link rel="canonical" href="{{ meta_canonical }}&pageno={{ pagination.paginationData.last }}" />
  50.             {# 途中のページ #}
  51.             {% else %}
  52.             <meta property="og:url" content="{{ meta_canonical }}&pageno={{ pagination.paginationData.current }}"/>
  53.             <link rel="next" href="{{ meta_canonical }}&pageno={{ pagination.paginationData.next }}" title="{{ Category.name }} {{ 'front.product.pageno'|trans({ '%pageno%': pagination.paginationData.next }) }}">
  54.             <link rel="prev" href="{{ meta_canonical }}&pageno={{ pagination.paginationData.previous }}" title="{{ Category.name }} {{ 'front.product.pageno'|trans({ '%pageno%': pagination.paginationData.previous }) }}">
  55.             <link rel="canonical" href="{{ meta_canonical }}&pageno={{ pagination.paginationData.current }}" />
  56.             {% endif %}
  57.         {% else %}
  58.         {# ページング無し #}
  59.         <meta property="og:url" content="{{ meta_canonical }}"/>
  60.         <link rel="canonical" href="{{ meta_canonical }}" />
  61.         {% endif %}
  62.     {# Other #}
  63.     {% else %}
  64.     <meta property="og:url" content="{{ meta_canonical }}"/>
  65.     <link rel="canonical" href="{{ meta_canonical }}" />
  66.     {% endif %}
  67. {% endif %}