Insert a HTML file in a Page

Hi all,

I was just trying to insert a HTML file into a page. The HTML files contains a few images, and the HTML file and images have been inserted into the File Resource in the Designer.

After i Create->Insert Resource->HTML, the images does not appear, but with a icon with a red cross. It seems that it can’t find the images.

Can someone please help? Thanks.

Subject: Insert a HTML file in a Page

This has to do with the base href and Domino…

The base href can jump from the domain, the database, the view, or the form throughout your application depending on your current location. I would imagine that you’re current base href is, as Domino is known to do this, pointing to the domain name and not your database. As your HTML file looks to the same directory level for the images (I would assume so anyways), you’re returning the dead image links.

The fast way to solve this is to use a “/” in front of the image name - , but this doesn’t fix the problem.

You’re best bet is to set the base href in the HTTP Header of your design element (in this case, a page) to use the database.

Put this in your HTML Head Contents section of the page:

“<base href="http://” + @GetHTTPHeader(“Host”) + “/” + @ReplaceSubstring(@ReplicaID;“:”;“”) + “/">”

This will return the following:

What this does, is tells the page to look prefix this to all of the internal links in your application for this particular design element…

Basically if you have an Image Resource called “image.gif”, you can now link to this Image Resource like this:

Now, with your example, since you’re HTML is written to link to , it will/should pick up the proper pathing and show your images as was designed.

HTH,

-Chris

Subject: RE: Insert a HTML file in a Page

I have tried your method. I still get the same error.

Anyone help?

Subject: Insert a HTML file in a Page

change your img tag src attributes to “\filenam.ext”

Subject: RE: Insert a HTML file in a Page

SOrry, i don’t quite understand.

For example, the content of the HTML is:

Then how should i change it?

Subject: RE: Insert a HTML file in a Page

Ah, the value of reading something twice! You’ll need your src parameter to contain the path to the db, followed by the image filename.

For example: “/subdir/dbfilename.nsf/logo.gif”

Since the img tag is embedded inside the inserted HTML file resource, I can’t think of a way to compute the db filename dnamically.

Have you considered importing the html into the Domino page/form (with File: Import) and inserting the image resources directly?