From ed4b067f8083566fa9de056fd7629278228bb2a5 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Tue, 10 Jun 2014 11:21:01 +0100 Subject: [PATCH] Emit each facet's title using the template named facetTitle-NAME, falling back to the old hardwired (maybe translated) caption in the common case when there is no such template. The template is invoked on a data object that at present contains only the current query. This provides the means to fix MKWS-214. --- src/mkws-widget-termlists.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mkws-widget-termlists.js b/src/mkws-widget-termlists.js index 1757b62..1f13820 100644 --- a/src/mkws-widget-termlists.js +++ b/src/mkws-widget-termlists.js @@ -44,7 +44,9 @@ mkws.registerWidgetType('Facet', function() { var teamName = that.team.name(); var acc = []; - acc.push('
' + mkws.M(caption) + '
'); + var template = that.team.loadTemplate('facetTitle-' + caption, mkws.M(caption)) + var title = template({ query: that.config.query }); + acc.push('
' + title + '
'); for (var i = 0; i < data.length && i < max; i++) { acc.push('
'); acc.push('