-
Notifications
You must be signed in to change notification settings - Fork 638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Programatically call taglibs #14
Comments
Custom tags are resolved to a "renderer" module at compile-time so it is not possible to support something like
var rendererA = require('./variant-A/renderer');
var rendererB = require('./variant-B/renderer');
var rendererC = require('./variant-C/renderer');
module.exports = function render(input, out) {
if (input.type === 'A') {
rendererA(input, out);
} else if (input.type === 'B') {
rendererB(input, out);
} else if (input.type === 'C') {
rendererC(input, out);
}
} This nice thing about that approach is that to the outside world there is only a single tag, but internally the custom tag renderer can delegate to the appropriate implementation. Let us know if that works or doesn't work for you. |
ping. Can you please let me know if the proposed solution meets your needs so that I can close this issue or keep it open? Thanks. |
This will work. Thanks. |
…tialization even if document is not ready
Is it possible to programmatically call taglibs?
Currently we can do the following when including template fragments:
I can include a different template based on the value of "module.alias".
I'd like to be able to have the same logic with taglibs. Something like this:
Currently I can do the following:
This would work but I'd like to avoid having to copy over the same parameter code.
The text was updated successfully, but these errors were encountered: