Power View Tricks

Power View Tricks

Display a Photo for a Contact

Choose a field in the Contact Form where you will enter the filename of each Contact's photo. Find the Core Field Name by right-clicking on the field and choosing Customize Field. (Heads Up: Don't modify the Form unless you have permission and know that the change won't adversely affect Custom Form Styles you may have.)

In this example, the Photo field is: CON:CON1_03_08 Substitute your field's Core Field Name in the code, below.

You also need a folder, typically in the Time Matters Shared Files Directory, where you will put copies of photos. In this example, the folder is: m:\photos\ Substitute a photos folder you create for the one in the example.

Find this line in the Contact Power View:
<h1>{CON:FIRST_NAME} {CON:LAST_NAME}</h1>

Insert the following line:

</td><td>&nbsp;<IMG SRC="m:\photos\{CON:CON1_03_08}" BORDER=0 onerror="this.parentNode.removeChild(this)" height=120>


Just before </body> at the very end of the Power View file, insert the following:

<!--
var imgs = document.getElementsByTagName('img')
        for(var i=0,j=imgs.length;i<j;i++){
                imgs[i].onerror = function(e){
                this.parentNode.removeChild(this);
        }
}
-->

Note: This page is formatted so that you can select the code in each of the boxes, above, and then copy and paste it into your Power View.

Copy photos into your photos folder. Enter the name of a Contact's photo, e.g., Robert-Brown.jpg, in the field you have chosen in the Contact record. Now the Contact's photo (if any) should appear when you highlight a Contact in the Contact list.