Closed bert-bruggeman closed 5 years ago
Elventy calls "shortcodes for blocks" paired shortcodes. There is documentation for this feature, too: https://www.11ty.io/docs/shortcodes/#paired-shortcodes.
Thanks for the anwser, but thats not what i mean,... An example: I would like to add a script or additional items to the footer of a page from a shortcode in the content, nunjucks uses "block" to accomplish this but I can't seem to find a way to make this work...
You've given an example of how you're defining you shortcode but it might be helpful to provide a sample input and expected output so we can see exactly what you're trying to accomplish.
Are you saying that you want a eleventy shortcode to be able to return Nunjucks content which will then be processed by Nunjucks? I'm not sure if there's an EASY way to accomplish this because it could potentially result problems when the Nunjucks code you're producing ends up calling itself it a loop.
I now realize using nunjucks blocks is not the correct way to solve my problem,... See issue 566, maybe this is a better method to achieve my goal...
How can I add content to a block in a layout from shortcodes? I would also like to use variables or objects like "collections" in schortcodes, is this possible?