-
Notifications
You must be signed in to change notification settings - Fork 5
/
example.html
60 lines (56 loc) · 2.48 KB
/
example.html
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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bibblio Related Content Example</title>
<meta name="description" content="Bibblio Related Content Example">
<meta name="Bibblio" content="SitePoint">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="canonical" href="http://example.com/" />
<!-- * Related Content Styles -->
<link rel="stylesheet" type="text/css" href="css/bib-related-content.css">
<!-- Example code, do not copy if you don't need simple querystring parsing -->
<script>
function getParameterByName(name, url) {
if (!url) url = window.location.href;
name = name.replace(/[\[\]]/g, "\\$&");
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, " "));
}
</script>
</head>
<body>
<!-- * Related Content HTML -->
<!-- Provide an enclosing element with an id. Position and size it as you wish. -->
<div id="bib_related-content"></div>
<!-- * Related Content Javascript -->
<script src="js/bib-related-content.js"></script>
<script>
// Initialise the related content plugin.
window.addEventListener("load", function() {
Bibblio.initRelatedContent({
targetElementId: 'bib_related-content',
// autoIngestion: true,
contentItemId: getParameterByName('contentItemId'),
recommendationKey: getParameterByName('recommendationKey'),
styleClasses: "bib--row-3 bib--hover bib--recency-show"
},
{
onRecommendationsRendered: function (recommendedItems) {
console.log(recommendedItems);
},
onRecommendationViewed: function (viewedTrackingData) {
console.log(viewedTrackingData);
},
onRecommendationClick: function (clickedItem, clickEvent) {
console.log(clickedItem);
console.log(clickEvent);
}
});
});
</script>
</body>
</html>