app/template/originalTemplate/Block/meta.twig line 1

Open in your IDE?
  1. {% set OGType = "article" %}
  2.     {% if subtitle is defined and subtitle is not empty %}
  3.         {% set titleTag = subtitle %}
  4.     {% elseif title is defined and title is not empty  %}
  5.         {% set titleTag = title %}
  6.     {% endif %}
  7.     {% if titleTag == "TOPページ" %}
  8.         {% set titleTag = "" %}
  9.         {% set OGType = "website" %}
  10.     {% endif %}
  11.     {% if titleTag %}
  12.         {% set titleTag = titleTag~" | " %}
  13.     {% endif %}
  14.     <title>{{ titleTag }}{{ BaseInfo.shop_name }}</title>
  15.     {% if Page.author is not empty %}
  16.         <meta name="author" content="{{ Page.author }}">
  17.     {% endif %}
  18.     
  19.     {# 下記の中身だけはその店舗のdescriptionに変えてください #}
  20.     {% set descriptionTag = "MUJINTOUではトレーニング用品を販売しています。" %}
  21.     {% if Page.description is not empty %}
  22.         {% set descriptionTag = Page.description %}
  23.     {% endif %}
  24.     {% if Product.description_detail is defined and Product.description_detail is not empty %}
  25.         {% set descriptionTag = Product.description_detail|replace({"\n":"", "\r":""}) %}
  26.     {% endif %}
  27.     {% if Category.name is defined and Category.name is not empty %}
  28.         {% set descriptionTag = Category.name~"カテゴリの商品一覧です。"~BaseInfo.shop_name~" オンラインショップ" %}
  29.     {% endif %}
  30.     {% if titleTag == "全商品 | " %}
  31.         {% set descriptionTag = BaseInfo.shop_name~" オンラインショップの商品一覧です。" %}
  32.     {% endif %}
  33.     {% if descriptionTag %}
  34.         {% set descriptionTag = descriptionTag|length > 120 ? descriptionTag|slice(0, 120) ~ '…' : descriptionTag %}
  35.     {% spaceless %}
  36.         <meta name="description" content="{{ descriptionTag }}">
  37.     {% endspaceless %}
  38.     {% endif %}
  39.     {% if Page.keyword is not empty %}
  40.         <meta name="keywords" content="{{ Page.keyword }}">
  41.     {% endif %}
  42.     {% if Page.meta_robots is not empty %}
  43.         <meta name="robots" content="{{ Page.meta_robots }}">
  44.     {% endif %}
  45.     <meta property="og:title" content="{{ titleTag }}{{ BaseInfo.shop_name }}">
  46.     <meta property="og:type" content="{{ OGType }}">
  47.     <meta property="og:url" content="{{ app.request.uri }}">
  48.     <meta property="og:description" content="{{ descriptionTag }}">
  49.     {% set OGImage = url('homepage')~"html/user_data/assets/img/common/og_image.png" %}
  50.     <link rel="icon" type="image/png" sizes="192x192" href="{{ asset('assets/img/common/android-chrome-192x192.png', 'user_data') }} ">
  51.     <link rel="apple-touch-icon" sizes="180x180" href="{{ asset('assets/img/common/apple-touch-icon-180x180.png', 'user_data') }} ">
  52.     {# カテゴリイメージがある場合は下記をアンコメント #}
  53.     {# {% if category_id is defined and category_id is not empty %}
  54.         {% set OGImage = url('homepage')~asset("assets/img/category/img_cate_pc-"~category_id~".jpg", 'user_data') %}
  55.     {% endif %} #}
  56.     {% if Product is defined and Product is not empty %}
  57.         {% set OGImage = url('homepage')~asset(Product.main_list_image|no_image_product, 'save_image') %}
  58.     {% endif %}
  59.     <meta property="og:image" content="{{ OGImage }}">
  60.     {% if Page.meta_tags is not empty %}
  61.         {{ include(template_from_string(Page.meta_tags)) }}
  62.     {% endif %}