Load dynamic content macro editor pop up window by overriding opener function

Hi Team,

I’m trying to override the macro editor pop up window by using soy template. I tried to override the opener function of AJS.MacroBrowser.setMacroJsOverride. I’m getting error saying “.customform” [my soy template name] is not found.

<--------------custom.js file ------------------->

AJS.bind('init.rte', function() {
    AJS.MacroBrowser.setMacroJsOverride('sample-link', {opener:
        function(macro) {
           // window.alert('PUT your JS in this function');
           var template=Confluence.Templates.Soycustomdialog.customform;

			contentId: Confluence.Editor.getContentId(),
			macro: {
				name: "sample-link",
				params: {
					search: "abcd",
					placeholder: "efgh"
				defaultParameterValue: "",
				body: undefined
		}, macro);


Configuration in .xml file

 <web-resource key="insert-link-javascript" name="Insert Link Dialog JavaScript">
        <!-- transform calls to AJS.getText() inside JS files -->
        transformation extension="js">
            transformer key="jsI18n"/>

        <!-- transform Soy templates into JS -->
        <transformation extension="soy">
            <transformer key="soyTransformer">

        <!-- JavaScript resources -->
        <resource name="custom.js" type="download" location="js/custom.js"/>
        <resource name="template.soy" type="download" location="js/template.soy"/>

        <!-- we need the editor resources to be loaded before these ones -->

        <!-- these resources will be included with any page containing the editor -->

I’ve attached snapshot of template.soy file as code is getting converted to html form while pasting it in the question.


Hi Team,

Could anyone please tell me what is the issue over here ? I did not find anything to resolve it .