projects
/
mkws-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Custom CredoImage template is used to attach a caption to each image.
[mkws-moved-to-github.git]
/
examples
/
htdocs
/
mkws-widget-credo.js
diff --git
a/examples/htdocs/mkws-widget-credo.js
b/examples/htdocs/mkws-widget-credo.js
index
5f689e2
..
d6ba4e7
100644
(file)
--- a/
examples/htdocs/mkws-widget-credo.js
+++ b/
examples/htdocs/mkws-widget-credo.js
@@
-6,6
+6,19
@@
mkws.registerWidgetType('Credo', function() {
var that = this;
mkws.registerWidgetType('Credo', function() {
var that = this;
+
+ this.team.registerTemplate('CredoImage', '\
+ <div>\
+ <a href="{{md-electronic-url}}">\
+ {{#mkws-first md-thumburl}}\
+ <img src="{{this}}" alt="{{../md-title}}"/>\
+ {{/mkws-first}}\
+ <br/>\
+ </a>\
+ <p>{{md-title}}</p>\
+ </div>\
+');
+
var s = []
s.push('<table>');
var s = []
s.push('<table>');
@@
-14,9
+27,10
@@
mkws.registerWidgetType('Credo', function() {
s.push('<td class="main">');
s.push(section('encyclopaedia', 'Topic Page: ### title',
s.push('<td class="main">');
s.push(section('encyclopaedia', 'Topic Page: ### title',
- this.subwidget('Reference')));
+ this.subwidget('Reference', { _team: 'ref' })));
+ // The Images widget needs to be in our team so we can set its template
s.push(section('image', 'Images',
s.push(section('image', 'Images',
- this.subwidget('GoogleImage', { maxrecs: 4 })));
+ this.subwidget('GoogleImage', { maxrecs: 4, template: 'CredoImage' })));
s.push('</td>');
s.push('<td class="side">');
s.push('</td>');
s.push('<td class="side">');