I have a raw template in my plugin at assets\javascripts\discourse\templates\connectors\topic-list-tags\template.raw.hbs that is not being inserted into the topic list.
Looking at the new code:
A raw plugin outlet uses connectorsFor
to find relevant templates.
But since connectorsFor
just looks in the _connectorCache
which is only populated from Ember.TEMPLATES
and not from Discourse.RAW_TEMPLATES
, it can’t find my template.raw.hbs file.
function buildConnectorCache() {
_connectorCache = {};
findOutlets(Ember.TEMPLATES, function(outletName, resource, uniqueName) {
_connectorCache[outletName] = _connectorCache[outletName] || [];
_connectorCache[outletName].push({
templateName: resource.replace('javascripts/', ''),
template: Ember.TEMPLATES[resource],
classNames: `${outletName}-outlet ${uniqueName}`,
connectorClass: findClass(outletName, uniqueName)
});
});
}
export function connectorsFor(outletName) {
if (!_connectorCache) { buildConnectorCache(); }
return _connectorCache[outletName] || [];
}
How should this be fixed or am I missing something?