Be really sure we have a template selector
Try to get popupOptions from the layer's options