You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now, however, I would like for my internal application which wraps the open source application to be able to modify the display of the output. This is a clear use case for template inheritance: I would modify those built-in templates to have blocks for the content I want to change downstream, and then extend them in the template_dir of my internal application. This doesn't appear to be possible: templates are read from template_dir before my try_custom callback is called, meaning that the on-disk templates fail to import due to missing dependencies.
Is there any way to provide static (i.e. in-code) templates which template_dir templates can inherit from?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hey folks,
I have an open-source Rocket application which I use as a library: some of its behaviour needs to be different for our internal usage, so it is instantiated with a pointer to a function which specifies that behaviour. This has worked perfectly for me so far as an API-only mechanism. I've also been able to add a basic templated front-end to it: I use static templates and
add_raw_template
so the templates are available to the library consumers.Now, however, I would like for my internal application which wraps the open source application to be able to modify the display of the output. This is a clear use case for template inheritance: I would modify those built-in templates to have blocks for the content I want to change downstream, and then extend them in the
template_dir
of my internal application. This doesn't appear to be possible: templates are read fromtemplate_dir
before mytry_custom
callback is called, meaning that the on-disk templates fail to import due to missing dependencies.Is there any way to provide static (i.e. in-code) templates which
template_dir
templates can inherit from?Thanks!
Beta Was this translation helpful? Give feedback.
All reactions