Read the statement by Michael Teeuw here.
MMM-Modal
-
@hango said in MMM-Modal:
template: “templates/MyModal.njk”,
I think u need
template: "../modulename/templates/MyModal.njk",
to make it relative to your module
instead of the modal module -
@hango said in MMM-Modal:
I make my modal:
this.sendNotification("OPEN_MODAL", { template: "templates/MyModal.njk", data: { title: "Test modal", message: "Test message" }, options: { isDialog: true } });
in console I get this:
nunjucks.min.js:4 GET http://localhost:8081/modules//modal/templates/modal.njk?s=1634300311396 404 (Not Found)
templates/MyModal.njk
doesn’t really fit with the error messagetemplates/modal.njk
?! Sure you have specified the correct path?
Referencing it to within your module path works just fine:template: "templates/MyModal.njk",
If this is possible…
That seems a bit rude. Just look at the linked modules in this thread which have this implemented successfully.
-
This post is deleted! -
This post is deleted! -
@hango is a bug, doesn’t use the template name
edit the MMM-Modal.js , add the one line below after line 236
if (!sender) { modal = { identifier: this.identifier, senderName: this.name, template: 'templates/HelpModal.njk', data: this.voice, options: {} } } else { modal.senderName = sender.name; modal.identifier = sender.identifier; modal.options = modal.options || {}; modal.data = modal.data || {}; modal.template: modal.template || 'templates/HelpModal.njk', // add this line }
-
@hango I responded with an MVP of a custom module using the modal in the related Github issue https://github.com/fewieden/MMM-Modal/issues/17
-
With MMM-NFL another module has now integrated the modals.
See the full list at https://github.com/fewieden/MMM-Modal/wiki/Depending-Modules