Closed p-wieser closed 5 months ago
Precision: the call is from JS code "After Content Ready".
@p-wieser We defined all parameters in After Content Ready
as a part of the context.
: https://volkovlabs.io/plugins/volkovlabs-dynamictext-panel/code/
Sorry, I do not understand your answer.
First, the documentation explicitly says to call "handlebars.registerHelper()", not context.handlerbars.... The screenshot in the doc is same (also directly invokes handlebars
object).
Second, my context only contains :
console.log( context );
data
dataFrame
element
grafana
eventBus
getLocale
locationService
notifyError
notifySuccess
replaceVariables
theme
timeRange
timezone
panelData
and nothing else.
In particular, the context.handlebars
said by the documentation is not here.
So could you be kind enough to explain a bit more, please ? Thanks in advance. Regards
@p-wieser Oh, I am sorry for the confusion. handlebars
are not available in the After Content Render.
Additional Handlebars
should be created in Before content Render, because they are used during the rendering process to convert Handlebars -> Markdown -> HTML. We may need to update documentation to make it clear if it's not.
After Content Render works with already created HTML elements and handlebars are not available at this point. Let me know if it's clear.
Ah, yes, I understand now :) And, yes, I believe that this could be more clear in the documentation, or at least just specified by the fact. Thanks for your help. Regards Pierre
Documentation updated: https://volkovlabs.io/plugins/volkovlabs-dynamictext-panel/code/#custom-handlebars-helper
Hello,
Well, all is in the title : when trying to call handlebars.registerHelper(), I get this error. Just to be sure, here is the offending line:
I do not see where the error is. Surely other eyes will just see it at first glance (I hope !) I run DynamicText 4.5.0 with Grafana 9.2.10
Could you please explain how to declare the handlebars context ? Thanks in advance. Best regards Pierre