Adding my own templates at startup

User 221559a7ff

22-07-2013 18:48:37

Hi,


I apologize if this question has been directly addressed before, but I can't seem to get this to work for me locally.


I want to add my own custom templates to the MarvinSketch webpage; when someone opens the "Insert > Template" menu, I want some of my own templates to show up there too.


My code to add the template is (in JS):


msketch_param("tmpls0", ":My Template:chemaxon/marvin/templates/myTemplate.mrv");


But that doesn't work; though the option "My Template" does show up, there are no molecules offered when I click on it.


I tried simply copy-and-pasting the homologyGroups.mrv file into my own template file, and the template still doesn't work. However, if I change the line of code to use the built-in template


msketch_param("tmpls0", ":My Template:chemaxon/marvin/templates/homologyGroups.mrv");


Then it works just fine.


What am I doing wrong?


Thanks,


Ulysse

ChemAxon 5433b8e56b

23-07-2013 06:41:45

Hi Ulysse,


the location of the template file in the parameter value has to be given relative to the applet codebase.


You can check from which exact URL the applet tries to download the template on the "Insert>Template Library" dialog, after you have selected your template set, on the rigth side you should switch to the properties tab, and check the location field for the template set. First, please check if the file is available at that location on your web server.


Regards,
Istvan 

User 221559a7ff

23-07-2013 16:43:41










ifajth wrote:

Hi Ulysse,


the location of the template file in the parameter value has to be given relative to the applet codebase.


You can check from which exact URL the applet tries to download the template on the "Insert>Template Library" dialog, after you have selected your template set, on the rigth side you should switch to the properties tab, and check the location field for the template set. First, please check if the file is available at that location on your web server.


Regards,
Istvan 



Hi Istvan,


You're completely right -- the file I was pointing to is not accessible from the client; I completely forgot that client-side JS was loading the file. I've placed my template in an accessible directory and now it works just fine.


Thanks for your help!


Ulysse

ChemAxon 5433b8e56b

24-07-2013 05:54:34

Hi Ulysse,


I am glad to hear it, if you have any further questions please do not hesitate to ask us.


Best regards,
Istvan