app/template/osechi/meta.twig line 1

Open in your IDE?
  1. {% set meta_og_type = 'website' %}
  2. {% set meta_canonical = app.request.uri %}
  3. {% set meta_description = '' %}
  4. {% if app.request.get('_route') == 'product_detail' %}
  5.     {% set meta_og_type = "og:product" %}
  6.     {% set meta_description = Product.description_detail| default(Product.description_list ) | default(Page.description) %}
  7.     {% set meta_canonical = url('product_detail', {'id': Product.id}) %}
  8.     {% if Product.search_word %}
  9.         {% set meta_og_title = Product.name~' / '~Product.search_word %}
  10.     {% else %}
  11.         {% set meta_og_title = Product.name %}
  12.     {% endif %}
  13.     {% set meta_og_img = absolute_url(asset(Product.main_list_image|no_image_product, 'save_image')) %}
  14.     <meta property="product:price:amount" content="{{ Product.getPrice02IncTaxMin }}"/>
  15.     <meta property="product:price:currency" content="{{ eccube_config.currency }}"/>
  16.     <meta property="product:product_link" content="{{ url('product_detail', {'id': Product.id}) }}"/>
  17.     <meta property="product:retailer_title" content="{{ BaseInfo.shop_name }}"/>
  18.     {% if not Product.stock_find %}
  19.         <meta name="robots" content="noindex">
  20.     {% endif %}
  21. {% elseif app.request.get('_route') == 'drive_detail' %}
  22.     {% set meta_og_type = "og:product" %}
  23.     {% set meta_description = Product.description_detail| default(Product.description_list ) | default(Page.description) %}
  24.     {% set meta_canonical = url('drive_detail', {'id': Product.id}) %}
  25.     {% if Product.search_word %}
  26.         {% set meta_og_title = Product.name~' / '~Product.search_word %}
  27.     {% else %}
  28.         {% set meta_og_title = Product.name %}
  29.     {% endif %}
  30.     {% set meta_og_img = absolute_url(asset(Product.main_list_image|no_image_product, 'save_image')) %}
  31.     <meta property="product:price:amount" content="{{ Product.getPrice02IncTaxMin }}"/>
  32.     <meta property="product:price:currency" content="{{ eccube_config.currency }}"/>
  33.     <meta property="product:product_link" content="{{ url('drive_detail', {'id': Product.id}) }}"/>
  34.     <meta property="product:retailer_title" content="{{ BaseInfo.shop_name }}"/>
  35.     {% if not Product.stock_find %}
  36.         <meta name="robots" content="noindex">
  37.     {% endif %}
  38. {% elseif app.request.get('_route') == 'rental_detail' %}
  39.     {% set meta_og_type = "og:product" %}
  40.     {% set meta_description = Product.description_detail| default(Product.description_list ) | default(Page.description) %}
  41.     {% set meta_canonical = url('rental_detail', {'id': Product.id}) %}
  42.     {% if Product.search_word %}
  43.         {% set meta_og_title = Product.name~' / '~Product.search_word %}
  44.     {% else %}
  45.         {% set meta_og_title = Product.name %}
  46.     {% endif %}
  47.     
  48.     {% set meta_og_img = absolute_url(asset(Product.main_list_image|no_image_product, 'save_image')) %}
  49.     <meta property="product:price:amount" content="{{ Product.getPrice02IncTaxMin }}"/>
  50.     <meta property="product:price:currency" content="{{ eccube_config.currency }}"/>
  51.     <meta property="product:product_link" content="{{ url('rental_detail', {'id': Product.id}) }}"/>
  52.     <meta property="product:retailer_title" content="{{ BaseInfo.shop_name }}"/>
  53.     {% if not Product.stock_find %}
  54.         <meta name="robots" content="noindex">
  55.     {% endif %}
  56. {% elseif app.request.get('_route') == 'ebike_detail' %}
  57.     {% set meta_og_type = "og:product" %}
  58.     {% set meta_description = Product.description_detail| default(Product.description_list ) | default(Page.description) %}
  59.     {% set meta_canonical = url('ebike_detail', {'id': Product.id}) %}
  60.     {% set meta_og_title = Product.name %}
  61.     {% set meta_og_img = absolute_url(asset(Product.main_list_image|no_image_product, 'save_image')) %}
  62.     <meta property="product:price:amount" content="{{ Product.getPrice02IncTaxMin }}"/>
  63.     <meta property="product:price:currency" content="{{ eccube_config.currency }}"/>
  64.     <meta property="product:product_link" content="{{ url('ebike_detail', {'id': Product.id}) }}"/>
  65.     <meta property="product:retailer_title" content="{{ BaseInfo.shop_name }}"/>
  66.     {% if not Product.stock_find %}
  67.         <meta name="robots" content="noindex">
  68.     {% endif %}
  69. {% elseif app.request.get('_route') == 'product_list' %}
  70.     {% set meta_canonical = url('product_list', {'category_id': Category.id|default(null)}) %}
  71.     {% if pagination|length == 0 %}
  72.         <meta name="robots" content="noindex">
  73.     {% endif %}
  74. {% elseif app.request.get('_route') == 'plan_detail' %}
  75.     {% set meta_description = WpPosts.list_text %}
  76.     {% set meta_og_img = WpPosts.main_img %}
  77. {% elseif app.request.get('_route') == 'news' %}
  78. {% elseif app.request.get('_route') == 'signature' or app.request.get('_route') == 'signature_complate' or app.request.get('_route') == 'rentalrule' or app.request.get('_route') == 'rentalrule_complate' or app.request.get('_route') == 'receipt' or app.request.get('_route') == 'receipt_complate' or app.request.get('_route') == 'magarigawa' or app.request.get('_route') == 'magarigawa_complate' %}
  79. {% elseif app.request.get('_route') == 'eventsignature' or app.request.get('_route') == 'eventsignature_complate' %}
  80. {% elseif app.request.get('_route') == 'homepage' %}
  81.     {% set meta_og_type = 'website' %}
  82.     {% set meta_canonical = url('homepage') %}
  83. {% elseif app.request.get('_route') == 'calc' %}
  84. {% elseif Page is defined and Page.edit_type == 0 and Page.url is defined %}
  85.     {% set meta_canonical = url(eccube_config.eccube_user_data_route, {'route': Page.url}) %}
  86. {% endif %}
  87. <meta property="og:title" content="{{ meta_og_title }}" />
  88. <meta property="og:type" content="{{ meta_og_type|default('article') }}"/>
  89. <meta property="og:site_name" content="A Wonderful Day"/>
  90. {% if meta_og_img is defined %}
  91.     <meta property="og:image" content="{{ meta_og_img }}">
  92. {% else %}
  93.     <meta property="og:image" content="https://giftlife.tokyo/{{ asset('assets/img/awd-share.webp') }}">
  94. {% endif %}
  95. {% set meta_description = meta_description | default(Page.description) %}
  96. {% if meta_description %}
  97.     <meta name="description" content="{{ meta_description|striptags|slice(0,120) }}">
  98.     <meta property="og:description" content="{{ meta_description|striptags|slice(0,120) }}"/>
  99. {% endif %}
  100. {% if meta_canonical|default() %}
  101.     {# canonical url #}
  102.     {# Product list #}
  103.     {% if Category is defined and Category %}
  104.         {% if pagination is defined and pagination.paginationData is defined and pagination.paginationData.pageCount > 1 %}
  105.             {# 最初のページ #}
  106.             {% if pagination.paginationData.current == 1  %}
  107.             <meta property="og:url" content="{{ meta_canonical }}"/>
  108.             <link rel="next" href="{{ meta_canonical }}&pageno=2" title="{{ Category.name }} {{ '%pageno%ページ目'|trans({ '%pageno%': 2 }) }}">
  109.             <link rel="canonical" href="{{ meta_canonical }}" />
  110.             {# 最後のページ #}
  111.             {% elseif pagination.paginationData.last == pagination.paginationData.current %}
  112.             <meta property="og:url" content="{{ meta_canonical }}&pageno={{ pagination.paginationData.last }}"/>
  113.             <link rel="prev" href="{{ meta_canonical }}&pageno={{ pagination.paginationData.previous }}" title="{{ Category.name }} {{ '%pageno%ページ目'|trans({ '%pageno%': pagination.paginationData.previous }) }}">
  114.             <link rel="canonical" href="{{ meta_canonical }}&pageno={{ pagination.paginationData.last }}" />
  115.             {# 途中のページ #}
  116.             {% else %}
  117.             <meta property="og:url" content="{{ meta_canonical }}&pageno={{ pagination.paginationData.current }}"/>
  118.             <link rel="next" href="{{ meta_canonical }}&pageno={{ pagination.paginationData.next }}" title="{{ Category.name }} {{ '%pageno%ページ目'|trans({ '%pageno%': pagination.paginationData.next }) }}">
  119.             <link rel="prev" href="{{ meta_canonical }}&pageno={{ pagination.paginationData.previous }}" title="{{ Category.name }} {{ '%pageno%ページ目'|trans({ '%pageno%': pagination.paginationData.previous }) }}">
  120.             <link rel="canonical" href="{{ meta_canonical }}&pageno={{ pagination.paginationData.current }}" />
  121.             {% endif %}
  122.         {% else %}
  123.         {# ページング無し #}
  124.         <meta property="og:url" content="{{ meta_canonical }}"/>
  125.         <link rel="canonical" href="{{ meta_canonical }}" />
  126.         {% endif %}
  127.     {# Other #}
  128.     {% else %}
  129.     <meta property="og:url" content="{{ meta_canonical }}"/>
  130.     <link rel="canonical" href="{{ meta_canonical }}" />
  131.     {% endif %}
  132. {% endif %}