From 0d29b3dc90ffb83ce2f8ee265f288bdb409af45c Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Wed, 21 May 2014 15:45:33 +0100 Subject: [PATCH] Custom CredoImage template is used to attach a caption to each image. Unfortunately, this breaks the float-clearing styles. Darn. Also, clicking on images goes to their site instead of doing a regular-ass MKWS full-record popup. --- examples/htdocs/mkws-widget-credo.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/examples/htdocs/mkws-widget-credo.js b/examples/htdocs/mkws-widget-credo.js index 46e9d29..d6ba4e7 100644 --- 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; + + this.team.registerTemplate('CredoImage', '\ +
\ + \ + {{#mkws-first md-thumburl}}\ + {{../md-title}}\ + {{/mkws-first}}\ +
\ +
\ +

{{md-title}}

\ +
\ +'); + var s = [] s.push(''); @@ -15,8 +28,9 @@ mkws.registerWidgetType('Credo', function() { s.push(''); s.push('
'); s.push(section('encyclopaedia', 'Topic Page: ### title', 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', - this.subwidget('GoogleImage', { _team: 'img', maxrecs: 4 }))); + this.subwidget('GoogleImage', { maxrecs: 4, template: 'CredoImage' }))); s.push(''); -- 1.7.10.4