Oct 29, 2021 10:15 PM
Hi there,
I've been using the {% module %} HubL tag in template source (according to these instructions) to instantiate custom modules, so far with success, but I'm now running into an apparent issue where changing the `path` argument (with the intent of swapping in a different custom module) seems to have no effect. Instead, the old module continues to be rendered - the one located at the old `path` - and no amount of checking, double-checking, reuploading through either the `hs` cli, or editing directly in Design Manager, seems to be able to convince the CMS to let go of the module at the old path and render the new one.
I freely admit I may be missing some step in the process or misunderstanding something, but the documentation on the 'path' argument seems very concise, with no caveats about this behavior.
Currently I can't provide code samples due to my work being guarded by an NDA, but I may be able to create a minimal reproduction if I find time. Until then, has anyone experienced this? Are there workarounds?
Solved! Go to Solution.
Nov 1, 2021 2:58 PM
My question applies specifically to the {% module %} tag, not {% dnd_module %}. dnd_modules seem trivially replaceable by deleting the old module and adding the new one through the CMS page editor UI.
In the hours after I posted this question, some experimentation led to similar points in @erod's post. Changing the id forced the path argument to be observed, though it had at least two undesirable side-effects:
Indeed, I ended up being sure that I was editing the correct template, but the initial 'stickiness' of the path argument had me doubting myself! Another reason this behavior feels buggy.
I did end up finding a workaround that addresses the above two points, involving the CMS Pages API:
Nov 1, 2021 2:58 PM
My question applies specifically to the {% module %} tag, not {% dnd_module %}. dnd_modules seem trivially replaceable by deleting the old module and adding the new one through the CMS page editor UI.
In the hours after I posted this question, some experimentation led to similar points in @erod's post. Changing the id forced the path argument to be observed, though it had at least two undesirable side-effects:
Indeed, I ended up being sure that I was editing the correct template, but the initial 'stickiness' of the path argument had me doubting myself! Another reason this behavior feels buggy.
I did end up finding a workaround that addresses the above two points, involving the CMS Pages API:
Nov 1, 2021 2:48 AM
Hi @yellcorp ,
Do you expect to swap the modules on live pages? If you used the new drag and drop coded templates or a flexible column, the following would apply:
Whenever a page is created by using a template, that page will be the new source for the modules shown on that page. Changing default content or changing a module will not change the content on the page that is created by the template, it will only show if you create a new page with that template. So if you want to switch the module, you should do this manually for each page. But again, this only applies to drag and drop and flexible column templates.
Oct 30, 2021 8:34 PM
I think I understand your question but I'm not sure I can give you a solution based on what you wrote so I'll ask the obvious questions: