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. {#▼RZ 2023.09.27 ADD トップページ用にOGP画像を設定▼#}
  23.     <meta property="og:image" content="{{ url('homepage') }}html/user_data/assets/img/common/hieiyuba_ogp.jpg"/>
  24.     <meta property="og:image:alt" content="滋賀県のこだわり湯葉専門店【比叡ゆば本舗ゆば八】オンラインショップ"/>
  25.     <meta property="og:title" content="滋賀県のこだわり湯葉専門店【比叡ゆば本舗ゆば八】オンラインショップ"/>
  26. {#▲RZ 2023.09.27 ADD トップページ用にOGP画像を設定▲#}
  27. {% elseif Page is defined and Page.edit_type == 0 and Page.url is defined %}
  28.     {% set meta_canonical = url(eccube_config.eccube_user_data_route, {'route': Page.url}) %}
  29. {% endif %}
  30. <meta property="og:type" content="{{ meta_og_type|default('article') }}"/>
  31. {#▼RZ 2023.09.27 EDIT サイト名に個別文言を設定▼#}
  32. {#
  33. <meta property="og:site_name" content="{{ BaseInfo.shop_name }}"/>
  34. #}
  35. <meta property="og:site_name" content="滋賀県のこだわり湯葉専門店【比叡ゆば本舗ゆば八】オンラインショップ"/>
  36. {#▲RZ 2023.09.27 EDIT サイト名に個別文言を設定▲#}
  37. {% set meta_description = meta_description | default(Page.description) %}
  38. {% if meta_description %}
  39.     <meta name="description" content="{{ meta_description|striptags|slice(0,120) }}">
  40.     <meta property="og:description" content="{{ meta_description|striptags|slice(0,120) }}"/>
  41. {% endif %}
  42. {% if meta_canonical|default() %}
  43.     {# canonical url #}
  44.     {# Product list #}
  45.     {% if Category is defined and Category %}
  46.         {% if pagination is defined and pagination.paginationData is defined and pagination.paginationData.pageCount > 1 %}
  47.             {# 最初のページ #}
  48.             {% if pagination.paginationData.current == 1  %}
  49.             <meta property="og:url" content="{{ meta_canonical }}"/>
  50.             <link rel="next" href="{{ meta_canonical }}&pageno=2" title="{{ Category.name }} {{ '%pageno%ページ目'|trans({ '%pageno%': 2 }) }}">
  51.             <link rel="canonical" href="{{ meta_canonical }}" />
  52.             {# 最後のページ #}
  53.             {% elseif pagination.paginationData.last == pagination.paginationData.current %}
  54.             <meta property="og:url" content="{{ meta_canonical }}&pageno={{ pagination.paginationData.last }}"/>
  55.             <link rel="prev" href="{{ meta_canonical }}&pageno={{ pagination.paginationData.previous }}" title="{{ Category.name }} {{ '%pageno%ページ目'|trans({ '%pageno%': pagination.paginationData.previous }) }}">
  56.             <link rel="canonical" href="{{ meta_canonical }}&pageno={{ pagination.paginationData.last }}" />
  57.             {# 途中のページ #}
  58.             {% else %}
  59.             <meta property="og:url" content="{{ meta_canonical }}&pageno={{ pagination.paginationData.current }}"/>
  60.             <link rel="next" href="{{ meta_canonical }}&pageno={{ pagination.paginationData.next }}" title="{{ Category.name }} {{ '%pageno%ページ目'|trans({ '%pageno%': pagination.paginationData.next }) }}">
  61.             <link rel="prev" href="{{ meta_canonical }}&pageno={{ pagination.paginationData.previous }}" title="{{ Category.name }} {{ '%pageno%ページ目'|trans({ '%pageno%': pagination.paginationData.previous }) }}">
  62.             <link rel="canonical" href="{{ meta_canonical }}&pageno={{ pagination.paginationData.current }}" />
  63.             {% endif %}
  64.         {% else %}
  65.         {# ページング無し #}
  66.         <meta property="og:url" content="{{ meta_canonical }}"/>
  67.         <link rel="canonical" href="{{ meta_canonical }}" />
  68.         {% endif %}
  69.     {# Other #}
  70.     {% else %}
  71.     <meta property="og:url" content="{{ meta_canonical }}"/>
  72.     <link rel="canonical" href="{{ meta_canonical }}" />
  73.     {% endif %}
  74. {% endif %}