Skip to content

Commit

Permalink
ref: EC-CUBE#6136 Organization, Websiteのマークアップを追加
Browse files Browse the repository at this point in the history
  • Loading branch information
tao-s committed Apr 11, 2024
1 parent ebec3e1 commit a43cd12
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 0 deletions.
44 changes: 44 additions & 0 deletions src/Eccube/Resource/template/default/Schema/organization.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"@context": "https://schema.org",
"@type": "Organization",
"url": "{{url('homepage')}}",
"logo": {
"@type": "ImageObject",
"contentUrl": "{{ asset('assets/img/common/favicon.ico', 'user_data') }}"
},
"name": "{{BaseInfo.shop_name}}",
"alternateName": "{{BaseInfo.shop_name_eng}}",
"legalName": "{{BaseInfo.company_name}}",
"description": "{{BaseInfo.message}}",
"email": "{{BaseInfo.email01}}",
"telephone": "+81-{{BaseInfo.phone_number}}",
"address": {
"@type": "PostalAddress",
"streetAddress": "{{BaseInfo.addr02}}",
"addressLocality": "{{BaseInfo.addr01}}",
"addressCountry": "JP",
"addressRegion": "{{BaseInfo.Pref.name}}",
"postalCode": "{{BaseInfo.postal_code}}"
},
"contactPoint": {
"@type": "ContactPoint",
"telephone": "+81-{{BaseInfo.phone_number}}",
"email": "{{BaseInfo.email02}}",
"url": "{{url('contact')}}"
}
{% if BaseInfo.invoice_registration_number is not null %}
,"iso6523Code": "0221:{{BaseInfo.invoice_registration_number}}"
{% endif %}
{#
,"image": "{{ asset('assets/img/common/site_image.png', 'user_data') }}",
"sameAs": [
"https://twitter.com/EC_CUBE",
"https://www.ec-cube.net/"
],
"numberOfEmployees": {
"@type": "QuantitativeValue",
"value": 2056
},
"foundingDate": "1970-01-01"
#}
}
20 changes: 20 additions & 0 deletions src/Eccube/Resource/template/default/Schema/website.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"@context" : "https://schema.org",
"@type" : "WebSite",
"name" : "{{BaseInfo.shop_name}}",
"alternateName" : "{{BaseInfo.shop_name_eng}}",
"url" : "{{url('homepage')}}",
"description": "{{BaseInfo.good_traded}}",
"potentialAction": {
"@type": "SearchAction",
"target": {
"@type": "EntryPoint",
"urlTemplate": "{{url('product_list')}}?name={search_term_string}"
},
"query-input": "required name=search_term_string"
},
"author":{{include('Schema/organization.twig')}}
{#
,"copyrightYear": "2024"
#}
}
3 changes: 3 additions & 0 deletions src/Eccube/Resource/template/default/default_frame.twig
Original file line number Diff line number Diff line change
Expand Up @@ -189,5 +189,8 @@ file that was distributed with this source code.
{{ include('snippet.twig', { snippets: plugin_snippets }) }}
{% endif %}
<script src="{{ asset('assets/js/customize.js', 'user_data') }}"></script>
<script type="application/ld+json">
{{ include('Schema/website.twig') }}
</script>
</body>
</html>

0 comments on commit a43cd12

Please sign in to comment.