1 |
efrain |
1 |
{{!
|
|
|
2 |
This file is part of Moodle - http://moodle.org/
|
|
|
3 |
|
|
|
4 |
Moodle is free software: you can redistribute it and/or modify
|
|
|
5 |
it under the terms of the GNU General Public License as published by
|
|
|
6 |
the Free Software Foundation, either version 3 of the License, or
|
|
|
7 |
(at your option) any later version.
|
|
|
8 |
|
|
|
9 |
Moodle is distributed in the hope that it will be useful,
|
|
|
10 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
11 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
12 |
GNU General Public License for more details.
|
|
|
13 |
|
|
|
14 |
You should have received a copy of the GNU General Public License
|
|
|
15 |
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
|
|
16 |
}}
|
|
|
17 |
{{!
|
|
|
18 |
@template block_rss_client/block
|
|
|
19 |
|
|
|
20 |
Template which defines an RSS Feeds block
|
|
|
21 |
|
|
|
22 |
Classes required for JS:
|
|
|
23 |
* none
|
|
|
24 |
|
|
|
25 |
Data attributes required for JS:
|
|
|
26 |
* none
|
|
|
27 |
|
|
|
28 |
Context variables required for this template:
|
|
|
29 |
* feeds - array: An array of RSS feeds.
|
|
|
30 |
|
|
|
31 |
Example context (json):
|
|
|
32 |
{
|
|
|
33 |
"feeds": [
|
|
|
34 |
{
|
|
|
35 |
"title": "News from around my living room",
|
|
|
36 |
"image": {
|
|
|
37 |
"url": "https://www.example.com/feeds/news/poster.jpg",
|
|
|
38 |
"title": "Example News Logo",
|
|
|
39 |
"link": "https://www.example.com/feeds/news/"
|
|
|
40 |
},
|
|
|
41 |
"items": [
|
|
|
42 |
{
|
|
|
43 |
"id": "https://www.example.com/node/12",
|
|
|
44 |
"link": "https://www.example.com/my-turtle-story.html",
|
|
|
45 |
"title": "My Turtle Story",
|
|
|
46 |
"description": "This is a story about my turtle.",
|
|
|
47 |
"permalink": "https://www.example.com/my-turtle-story.html",
|
|
|
48 |
"datepublished": "11 January 2016, 7:11 pm"
|
|
|
49 |
},
|
|
|
50 |
{
|
|
|
51 |
"id": "https://www.example.com/node/12",
|
|
|
52 |
"link": "https://www.example.com/my-cat-story.html",
|
|
|
53 |
"title": "My Story",
|
|
|
54 |
"description": "This is a story about my cats.",
|
|
|
55 |
"permalink": "https://www.example.com/my-cat-story.html",
|
|
|
56 |
"datepublished": "12 January 2016, 9:12 pm"
|
|
|
57 |
}
|
|
|
58 |
]
|
|
|
59 |
},
|
|
|
60 |
{
|
|
|
61 |
"title": "News from around my kitchen",
|
|
|
62 |
"image": {
|
|
|
63 |
"url": "https://www.example.com/feeds/news/kitchen.jpg",
|
|
|
64 |
"title": "Picture of My Kitchen",
|
|
|
65 |
"link": "https://www.example.com/feeds/news/kitchen/"
|
|
|
66 |
},
|
|
|
67 |
"items": [
|
|
|
68 |
{
|
|
|
69 |
"id": "https://www.example.com/node/10",
|
|
|
70 |
"link": "https://www.example.com/oven-smoke.html",
|
|
|
71 |
"title": "Why is the Oven Smoking?",
|
|
|
72 |
"description": "There is something smoking in the oven.",
|
|
|
73 |
"permalink": "https://www.example.com/oven-smoke.html",
|
|
|
74 |
"datepublished": "10 January 2016, 1:13 pm"
|
|
|
75 |
},
|
|
|
76 |
{
|
|
|
77 |
"id": "https://www.example.com/node/13",
|
|
|
78 |
"link": "https://www.example.com/coffee-is-good.html",
|
|
|
79 |
"title": "Why My Coffee Machine is So Great!",
|
|
|
80 |
"description": "Don't be fancy; drips are best.",
|
|
|
81 |
"permalink": "https://www.example.com/oven-smoke.html",
|
|
|
82 |
"datepublished": "13 January 2016, 8:25 pm"
|
|
|
83 |
}
|
|
|
84 |
]
|
|
|
85 |
}
|
|
|
86 |
]
|
|
|
87 |
}
|
|
|
88 |
}}
|
|
|
89 |
{{#feeds}}
|
|
|
90 |
{{> block_rss_client/feed}}
|
|
|
91 |
{{/feeds}}
|