cancel
Showing results for 
Search instead for 
Did you mean: 

How to specify custom template for modal

SOLVED

How to specify custom template for modal

How can I specify an custom template for an modal? I tried to specify the type and customTemplate, but no luck. The template file is called modal-gallery.html and is placed on the same path as the modal-popup.

var modalOptions = {
type: 'gallery',
customTpl: 'gallery'
};
jQuery('<div />').modal(modalOptions).modal('openModal');

 

Tags (1)
1 REPLY

Re: How to specify custom template for modal

found the answer by myself. You need to define 'text!ui/template/modal/modal-gallery.html' as galleryTpl and use the modalOptions as below:

var modalOptions = {
type: 'gallery',
customTpl: 'gallery',
galleryTpl: galleryTpl,
};