-
-
Notifications
You must be signed in to change notification settings - Fork 36
Description
Describe the bug
We have a site hosted on Servd which makes use of static caching. They provide a dynamicInclude twig tag to omit certain parts of a template from the cache.
When including the comments templates via this dynamicInclude, both the css and JS files are not outputted, despite being selected to in the CMS.
{% dynamicInclude '_components/c-comments' %}
The comments template is basically just rendering the comments:
{{ craft.comments.render(entry.id) }}
I've overridden some templates for styling purposes. I've removed certain functionality that wasn't in use, such as the can guest comment code and notify subscribed users code. But other than that, they should be identical.
Due to this, I have opted to render the JS and CSS manually. The CSS does appear to work. The JS file is rendered, but doesn't seem to be actually doing anything. When I press to submit a comment, the page just refreshes without anything happening. I can't see any console errors either. The comments are not saved.
I am wondering if this has some kind of similar interaction as if it were Sprig? I am not sure if that has been looked into.
I've tried rendering the css and JS at the top of the parent template but this doesn't make a difference.
I expect that the JS would still work since its being outputted on the page. Let me know if you need any more information.
Thanks!
Steps to reproduce
- Include a template which renders the comments using dynamicInclude
- Select output css and JS in CMS settings
- Verify nothing is ouputted
- Manually output css and JS
- Verify css works, but JS doesn't seem to be doing anything
Craft CMS version
4.4.9
Plugin version
2.0.7
Multi-site?
No
Additional context
- Happens on local uncached version and staging static cached environment
- Example video: