x

How do I access App Assets from the HTML for the App

I'm building an App and have included the image asset (myImage.png) I need in the Assets folder for the App. I'm creating a zip of the App Folder (containing the Assets, CSS, HTML and JS folders and the icon) and the manifest. I upload that zip to my development account and then install the App to the development site. 

In the element.tpl file in the HTML folder I have an <img src="/files/theme/images/myImage.png"> tag to display the image that was added to the website when the App was installed. But the image is not displayed in either the preview or the published site.

I'm assuming I'm looking at the wrong path. Can you please let me know how to reference the asset files uploaded with an App from the HTML within the App?

Thanks,

Richard

1,998 Views
Message 1 of 2
Report
1 REPLY 1

Images can be accessed from within your template files by referencing the physical path (rather than the logical path):

Per the docs: https://dev.weebly.com/theme-directory-structure.html

Always use the physical path when you refer to assets in your code.  For example, to refer to images in the Base theme, you would use /images/dark-background.jpg and not /assets/images/dark-background.jpg.

Does this help solve your problem?

Tags (1)
1,966 Views
Message 2 of 2
Report