How to add parameters for templates? #1873
-
I am working on an extension for CSS. Am I missing something easier to add this custom value to be injected in my template? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
There is no immediate out-of-the-box solution for this. Your main two options seem to be to either add an additional component that is similar to the HtmlViewHandlerCreate a new class that extends the Specific Overrides can be used to determine the position of your new element in an existing array. See the documentation here or some info in the tutorial here. The templates you then provide to your new class would be the ones that need those new parameters. EjsTemplateEngineSimilar as above, but instead create a class similar to the This would impact all resources that use the template engine, not just your new ones. But that seems like not that much of an issue. |
Beta Was this translation helpful? Give feedback.
-
@joachimvh Thanks for the help, however while implementing I found out the the "overrideSteps" parameter is not accepted raising an "Invalid Predicate IRI: overrideSteps" error. Am I doing something wrong?
|
Beta Was this translation helpful? Give feedback.
There is no immediate out-of-the-box solution for this. Your main two options seem to be to either add an additional component that is similar to the
HtmlViewhandler
, or a newEjsTemplateEngine
.HtmlViewHandler
Create a new class that extends the
HtmlViewHandler
, but have a new implementation ofhandle
so it sends your additional parameter(s). Insert it in front of the other elements in the array here.Specific Overrides can be used to determine the position of your new element in an existing array. See the documentation here or some info in the tutorial here.
The templates you then provide to your new class would be the ones that need those new parameters.
EjsTemplateEngine
Similar as ab…