I’ve created a Notes database that allows users to create content in the Notes client which is then served on the web. Part of what they need to do is enter a URL in a field on the document, and then be able to create a hotspot in the actual content rich text field that points to the page indicated in the URL field.
So I have a field called URL1 and in that field I enter “http://www.companysite.com/mydocument” and then in the Body field which is actually hosted on the web, I create text or an image and then create a hotspot around the text or image and point that hotspot to the value in the URL field.
I’ve tried a few things and so far, nothing works. Any help would be greatly appreciated!
Subject: Point hotspots to a field on the document
Have you tried creating an tag pair programatically in the rich text field where you want the link to go? This should create the link when converted to html by the browser. You can also build an image tag with a link. Ultimately, that’s what’s going to matter: the html you end up with in the rtf field on the web.
Subject: RE: Point hotspots to a field on the document
Thanks, Joel. I’ll try and play with that today but could you provide a little more information about what you have in mind?
This has to be relatively easy to do for the user. It’s OK to have the user select text or a graphic and create a Hotspot in Notes which points to another field in the same document, but I don’t want to force the user to to type in pass-thru HTML by hand.
Subject: RE: Point hotspots to a field on the document
The end user would enter the URL in a provided text field in the Notes Client and perhaps selectthe file name for the image they want to use from a dropdown list (so you can provide the images
in image resources or attached to separate documents)
There would next be a button which, when clicked would insert the code into the rtf at the place where the cursor
is. This would be done in LS and you could have additional code to place the cursor after the last paragraph (or at the beginning)
if the insertion point when the button is clicked is NOT in the rtf field.
Subject: RE: Point hotspots to a field on the document
Wow, Joel, thanks VERY much for all the help. I’m certainly going to give this a try.
Users need to be able to put whatever text or images they like, including new images I haven’t seen before, so I can’t give them a set list of images but I’ll take a look at this code and see what we can do with it.
But there’s no way to just reference the contents of another field in any kind of hotspot definition?
Subject: RE: Point hotspots to a field on the document
Thanks very much for the solution, Ben. Unfortunately while it works in the Notes client it doesn’t seem to work when the document is published on the web. I get this server error, which points to the document containing the link fields:
HTTP Web Server: Lotus Notes Exception - @SetDocField and @GetDocField cannot access the document currently being computed [/DATABASE.NSF/DocsByNumber/SOP-0011?OpenDocument]
Is there some other way to programatically access the current document in a URL reference? So far I’ve tried @DocumentUniqueID and @Text(@DocumentUniqueID) with no luck.
Subject: RE: Point hotspots to a field on the document
For the current document, you can just use the fieldname, but make sure it is above or to the left of the computed value so that it will compute properly the first time.
This code merely looks at a computed field. The value of the url is computed from a list of image urls that have been created when the end user attaches the files to documents in the database that store them. The dialdogbox field is computed when the document is created and can be a dbcolumn of the values in a view containing the attachment documents. In this way, users can attach images to documents in the database, and use this list to build an url to the images on those documents.