diff --git a/src/js/classes/config/gogo-config.class.ts b/src/js/classes/config/gogo-config.class.ts index c229b08..d3ad740 100644 --- a/src/js/classes/config/gogo-config.class.ts +++ b/src/js/classes/config/gogo-config.class.ts @@ -47,6 +47,7 @@ export class GoGoConfig { width: undefined, activate: true, + bodyTemplate: undefined }; readonly general = { @@ -146,7 +147,6 @@ export class GoGoConfig titleFont: undefined , taxonomyMainTitleFont: undefined , } - readonly bodyTemplate = undefined; constructor(config : any) { @@ -201,7 +201,11 @@ export class GoGoConfig switch(prop) { case 'defaultBounds' : new_prop = L.latLngBounds(object[prop]);break; case 'defaultCenter' : new_prop = L.latLng(object[prop]);break; - case 'bodyTemplate': let parser=new commonmark.Parser(),htmlRenderer=new commonmark.HtmlRenderer();new_prop=htmlRenderer.render(parser.parse(object[prop]));break; + case 'bodyTemplate': + let parser = new commonmark.Parser() + let htmlRenderer = new commonmark.HtmlRenderer(); + new_prop = htmlRenderer.render(parser.parse(object[prop])); + break; default: new_prop = object[prop];break; } that[prop] = new_prop; diff --git a/src/js/components/element/element.component.ts b/src/js/components/element/element.component.ts index 86658db..424a638 100644 --- a/src/js/components/element/element.component.ts +++ b/src/js/components/element/element.component.ts @@ -59,7 +59,11 @@ export class ElementComponent }; // If there is a body template configured, then we use it. We use the default body otherwise. - if(App.config.bodyTemplate) options.body = nunjucks.renderString(App.config.bodyTemplate, this.element).replace(/&/g, "&").replace(/>/g, ">").replace(/</g, "<").replace(/"/g, '"'); + if (App.config.infobar.bodyTemplate) + { + options.body = nunjucks.renderString(App.config.infobar.bodyTemplate, this.element); + options.body = options.body.replace(/&/g, "&").replace(/>/g, ">").replace(/</g, "<").replace(/"/g, '"'); + } else options.body = nunjucks.render('components/element/body.html.njk', options); let html = App.templateModule.render('element', options);