-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJSON-LD_Book
64 lines (64 loc) · 2.26 KB
/
JSON-LD_Book
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "WebPage",
"breadcrumb": "Home Page <txp:breadcrumb label="" separator=" > " link="0" wraptag="" />",
"mainEntity":
[
{
"@type": "BookStore",
"name": "<txp:site_name escape="json" />",
"telephone": "+33 XXX-XXX-XXX",
"address": {
"@type": "PostalAddress",
"addressCountry": "France",
"addressLocality": "XXXX",
"addressRegion": "XXXX",
"postalCode":"XXXX",
"streetAddress": "XXXX"
},
"priceRange": "€€",
"image": "<txp:site_url />img\/logo.png"
},<txp:article limit="10" status="life">
{
"@type": "Book",
"name": "<txp:title escape="json" />",
"author": {
"@type": "Person",
"name" : "<txp:author escape="json" />",
"url": "<txp:author format="url" />"
},
"inLanguage": "<txp:custom_field name="Language" />",
"numberOfPages": "<txp:custom_field name="Pages" />",
"isbn": "<txp:custom_field name="ISBN" />",
"datePublished": "<txp:posted format="%Y-%m-%d" />",
"bookFormat": "<txp:if_custom_field name="Format" value="eBook">http://schema.org/EBook<txp:else />http://schema.org/PaperBack</txp:if_custom_field>",
<txp:if_article_image>"image": "<txp:images><txp:image_url /></txp:images>",</txp:if_article_image>
<txp:if_excerpt>"description" : "<txp:php>
/*
* Retrieve the plain text excerpt version from the 'textpattern' table.
*/
echo json_encode(safe_field('Excerpt', 'textpattern', 'ID = "'.article_id(array()).'"'));</txp:php>",</txp:if_excerpt>
"offers":
{
"@type": "Offer",
"price": "<txp:custom_field name="Price" />",
"priceCurrency": "EUR",
<txp:if_custom_field name="Stock">"availability": "http://schema.org/InStock"<txp:else />"availability": "http://schema.org/OutOfStock"</txp:if_custom_field>
}
},</txp:article>
{
"@type": "BreadcrumbList",
"itemListElement": [
<txp:section_list exclude="XXXXX" wraptag="" break="},">
<txp:variable name="Book_counter" value="0" /> {
"@type": "ListItem",
"position": <txp:variable name="Book_counter" value='<txp:evaluate query=''<txp:variable name="Book_counter" /> + 1'' />' /><txp:variable name="Book_counter" />,
"@id": "<txp:section link="0" url="1" />",
"name": "<txp:section title="1" escape="json" />"
</txp:section_list>}
]
}
]
}
</script>