I haven't tried to write a web engine so don't know the answer off the top of my head. A quick glance at the SDK guide and the two SDK samples didn't give me any hints at the answer.
Before I nudge one of the gallery developers to see if they know the answer I need to confirm one thing. Can you please confirm you have a file in the same directory as your manifest using the name "myfunctions.lua", and that your require statement looks something like this:
(Thie filename should be considered case sensitive).
I know its an obvious question but I need to ask before I ask one of the others for assistance.
UPDATE: It might also be worth having a look at Sean's 3 post series on web galleries, which is the only other resource I can recall re building web galleries.
Added additional resource re web gallery development
Thanks for the quick response. Yes I have a file called myfunctions.lua in the same directory as my manifest.lrweb file. Sean's posts are great but he doesn't seem to cover it either.
Thanks for confirming that Mark. I've nudged some of the web gallery developers and hopefully they can help out.
1 person found this helpful
I'd be so sketchy remembering.. first thing I would do is list it as a Resource via AddResource in manifest.lrweb, that way it gets added to the plugin, then call it using the standard include : <% includeFile( "filename" ) %> in the HTML where you're running the functions.
Good call... so a few changes and it works
1) Had to change myfunctions.lua to have a <% at the start of the file and a %> at the end (natually since the include brings in the file contents and wanted the lua to execute in the html file.
2) Don't seem to need it in the resources manifest.lrweb as long as it is in the current directory -- not quite sure why this is the case but even in the simple example in the sdk manual with header.html the file header.html isn't in the AddResource statement.
Ah.. yes you wouldn't need the AddResource because it's not being created in the final gallery output.. silly me.