cowgod
Member
I'm trying to write my first addon and having some difficulties getting started. I need to add some JavaScript files and the add-on has a few images that it will require, as well as the ability to save new images.
According to the documentation, you can add JavaScript tags like this:
<xf:js src="myaddon/vendor/scripts/myjs_file.js" />
So does this mean I have to manually place my files there? Or do I put them in my add-on _data directory and they get copied there? It seems like they should go in the _data directory so that the files can be verified against the hashes.json file, but the documentation doesn't explain how you would copy them over if that's the case.
Same question goes for images. Also, there's no <xf:img> tag? Do I just use regular <img> tags in templates for those then? Is there a variable that I use to get the relative path to my add-on? Or am I just supposed to hard code it to /src/addons/MyAddon/?
Is there a tutorial for getting started with add-ons other than the developer docs?
According to the documentation, you can add JavaScript tags like this:
<xf:js src="myaddon/vendor/scripts/myjs_file.js" />
So does this mean I have to manually place my files there? Or do I put them in my add-on _data directory and they get copied there? It seems like they should go in the _data directory so that the files can be verified against the hashes.json file, but the documentation doesn't explain how you would copy them over if that's the case.
Same question goes for images. Also, there's no <xf:img> tag? Do I just use regular <img> tags in templates for those then? Is there a variable that I use to get the relative path to my add-on? Or am I just supposed to hard code it to /src/addons/MyAddon/?
Is there a tutorial for getting started with add-ons other than the developer docs?