If you have a field in the database that contains a URL for a file or image, or an email address and you would like to create a link on the displayed page, you will need to add some simple HTML code in your HTML layout page file in order to accomplish this.
Here is some sample HTML that you can use:
<a href='<GEN:FIELDVALUE NAME="URLFieldOne"/>'><GEN:FIELDVALUE NAME="URLFieldTwo"/></a>
If you want to open the link in a new window, you would set the target to _blank.
<a href='<GEN:FIELDVALUE NAME="URLFieldOne"/>' target=”_blank”><GEN:FIELDVALUE NAME="URLFieldTwo"/></a>
If the database field contains an email address, the sample HTML you can use is:
<a href='mailto:<GEN:FIELDVALUE NAME="EmailFieldOne"/>’><GEN:FIELDVALUE NAME="EmailFieldTwo"/></a>
Note that the outer strings are enclosed in single quotes (') and the inner strings are enclosed in double quotes (").
The first FieldOne is used by the href tag and the second FieldTwo is what is displayed to the user. If you want to display something else on the page, but the link points to the file, you can replace the second GEN:FieldValue with a constant string or another field.
Step 1: Place the above HTML in your page’s HTML layout page.
Step 2: Return to the Design tab and launch the Page Properties dialog from the Tools menu.
Step 3: In the Page Properties dialog, click on the Show Tree button at the bottom to display all the GEN: tags on the page. Navigate to the newly placed tags: FieldOne, FieldTwo, EmailFieldOne or EmailFieldTwo. You may need to expand the tree nodes.
Step 4: In the Display tab, select Literal as the Display Option for each of the newly placed tags. Make sure the field is Visible in the Display Style area.
Step 5: In the Bindings tab, select the database table name and field name for each of the newly placed tags.
Step 6: Press OK to save your settings.
Step 7: Rebuild and run your application.