Display a User's Facebook Profile Photo

FacebookLinkedInStumbleUponTwitterShare

Once you have created a Caspio App that uses Facebook registration you can automatically display the user’s current Facebook Profile photo using the Facebook ID saved to your authentication table.

Facebook Default Profile Image

Just add the following code into a DataPage.  Make sure that Advanced Options and Parameters are enabled.

<img src="https://graph.facebook.com/[@authfield:Facebook_ID]/picture">

Replace Facebook_ID with the appropriate field name that holds your users Facebook ID.

If you want to display the Facebook image only if the user has a Facebook ID saved you can use the following JavaScript:

<script>
if ("[@authfield:Facebook_ID]" != ""){
document.write("<img src='https://graph.facebook.com/[@authfield:Facebook_ID]/picture'>");
}
</script>

Again, replace Facebook_ID with the appropriate field name that holds your users Facebook ID.

Contact Support

Leave a Reply

 
© 2011 Caspio, Inc. All rights reserved! Sitemap | Terms of Use | Privacy Statement Suffusion theme by Sayontan Sinha