x

Filepath of Site's Assets

I want to source an html page within an iframe in the html code within a standard page

Visually:

standard page -> html code -> iframe -> source an asset (html file) within the site's "Asset" folder

My question: What is the filepath to the site assets? I need the whole file path in order to use it for the "source" argument of the iframe element.

Again, I am simply looking for the file path to the site assets folder - likely something standard across client accounts... I already uploaded the asset (in this case an html document).

HTML code: <iframe height="600" width="100%" src="~/buildingKeyspaces_verI_full.html" name="iframe_a"></iframe>

Thanks!!!

10,414 Views
Message 1 of 20
Report
1 Best Answer

Best Answer

Just a recap, as I had this issue today myself and spent quite some time on it as it wasn't working (for one or more of the following reasons)

The correct way to specify the filepath is :

a) with a forward slash in the beginning
i.e. /files/theme/mypicture.png

b) including any custom folders within the assets section under which the file resides (/files/theme is the mandatory path, the root of the assets section, so any additional folders come after that)
i.e. /files/theme/images/mypicture.png, /files/theme/MyFiles/mypicture.png

c) paying attention to letter case as the path is case sensitive
i.e. /files/theme/images/mypicture.png is different to
/files/theme/Images/mypicture.png and also to
/files/theme/images/Mypicture.png

HTH

View Best Answer >

5,984 Views
Message 21 of 20
Report
19 REPLIES 19
Square

I replied to your other post about this, but just for reference this is the path to a file uploaded to the assets folder:

/files/theme/myfile.extension

10,411 Views
Message 21 of 20
Report

Suggestion:  Add the path info to this doc:

https://dev.weebly.com/internal-docs-en.html

10,386 Views
Message 21 of 20
Report
Square

Good suggestion! There should be a form on the bottom of that page where you can submit that idea.

10,381 Views
Message 21 of 20
Report


@Adam wrote:

Good suggestion! There should be a form on the bottom of that page where you can submit that idea.


Don't see such a form.

Also, is not the file path technically:

files/theme/myfile.extension

so it should be coded something like this: 

link rel="stylesheet" href="files/theme/my_stylesheet.css"

10,365 Views
Message 21 of 20
Report
Square

That would work too - the initial forward slash is optional.  You don't see a Doc Feedback form way at the bottom of this page?

https://dev.weebly.com/get-started-with-themes.html

10,363 Views
Message 21 of 20
Report

Hi. This is not working for me.

I uploaded the image, added an Embed Code block, then added the following code:

<img src="/files/theme/myfilename.jpg">

Nothing is happening. Please advise.

9,855 Views
Message 21 of 20
Report
Square

I think this might be because your site is un-published, @ThomasG. Try publishing and see how it goes.

9,847 Views
Message 21 of 20
Report

Thanks, Adam. Unfortunately that doesn't seem to be the issue.

I had tried while it was published (I only publish it while I'm working on it, which is why you see it as unpublished), and I just tried again to be certain. The image is still not appearing. Also tried another image and that's not working either. The images are not corrupted; they open normally in Preview, Photoshop, etc.

Any other suggestions?

9,841 Views
Message 21 of 20
Report
Square

I did a little testing on a test site of my own, and this file path worked for me when I added an image to the "images" folder within the "assets" folder:

/files/theme/images/filename.extension
9,839 Views
Message 21 of 20
Report

ok thanks. two things:

1. you just said it's:

/files/theme/images/filename.extension

but in a previous post you said it's: 

/files/theme/filename.extension

which one is correct?

2. what is the correct code for displaying an uploaded image using Embed Code? i've tried both <img src="/files/theme/images/filename.extension.png"> and <img src="/files/theme/filename.extension.png"> but neither one works.

thank you.

5,448 Views
Message 21 of 20
Report
Square

The second example I gave is correct - we updated some things with the theme editor and the path changed.

If your file is called "myimage.png", then the image code would look like this:

<img src="/files/theme/images/myimage.png" />
5,434 Views
Message 21 of 20
Report

yes, now it's working. thanks for your help.

5,427 Views
Message 21 of 20
Report
Square

Awesome! Glad to hear that.

5,421 Views
Message 21 of 20
Report

Hello Adam:

Thank you for addressing the issue raised by Thomas.   Do I use exactly the terms "files/theme/images" or do I replace these words by ones specific to my website?

2,701 Views
Message 21 of 20
Report
Square

If you click the gear icon directly to the right of "images" you can upload your image to that folder, by the way.

5,456 Views
Message 21 of 20
Report

thanks.

5,426 Views
Message 21 of 20
Report

Best Answer

Just a recap, as I had this issue today myself and spent quite some time on it as it wasn't working (for one or more of the following reasons)

The correct way to specify the filepath is :

a) with a forward slash in the beginning
i.e. /files/theme/mypicture.png

b) including any custom folders within the assets section under which the file resides (/files/theme is the mandatory path, the root of the assets section, so any additional folders come after that)
i.e. /files/theme/images/mypicture.png, /files/theme/MyFiles/mypicture.png

c) paying attention to letter case as the path is case sensitive
i.e. /files/theme/images/mypicture.png is different to
/files/theme/Images/mypicture.png and also to
/files/theme/images/Mypicture.png

HTH

5,985 Views
Message 21 of 20
Report
Square

Thanks for posting that, @GThalassinosNet! I marked your post as a solution to make it easier for people to find it.

4,169 Views
Message 21 of 20
Report

It works great!!

3,910 Views
Message 21 of 20
Report
This thread has been archived and locked. Please start a new thread if you would like to continue the conversation.