Skip to content

Instantly share code, notes, and snippets.

@TheVishnuKumar
Created January 13, 2019 18:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheVishnuKumar/cfd16f9ca52dba748ea4ed12af78dc70 to your computer and use it in GitHub Desktop.
Save TheVishnuKumar/cfd16f9ca52dba748ea4ed12af78dc70 to your computer and use it in GitHub Desktop.
<template>
<iframe
src={facebookSrc}
width="340"
height="500"
style="border:none;overflow:hidden"
scrolling="no"></iframe>
</template>
import { LightningElement ,api, wire} from 'lwc';
import { getRecord } from 'lightning/uiRecordApi';
import FBURL from '@salesforce/schema/Account.Facebook_Page_URL__c';
export default class Facebooktimeline extends LightningElement {
@api recordId;
@wire(getRecord, { recordId: '$recordId', fields: [FBURL] })
Account;
get facebookSrc() {
if( typeof this.Account.data !== 'undefined' ){
return 'https://www.facebook.com/plugins/page.php?href='+this.Account.data.fields.Facebook_Page_URL__c.value+
'&tabs=timeline&width=340&height=500&small_header=true&adapt_container_width=true&hide_cover=true&show_facepile=false&appId';
}
}
}
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="facebooktimeline">
<apiVersion>45.0</apiVersion>
<isExposed>true</isExposed>
<targets>
<target>lightning__AppPage</target>
<target>lightning__RecordPage</target>
<target>lightning__HomePage</target>
</targets>
</LightningComponentBundle>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment