Add Facebook comments/Like Button to your website



# 2 > Create new App Id

-> go to https://developers.facebook.com/
-> Click My Apps -> Add New App
-> Give a name to your app 
-> Enter Email address
->Click "Create App Id"

 


# 3 > Viewing your app in face book

-> choose your app id on face bood to view it


# 4 > Add Comments #1 - Code Generator

Go to https://developers.facebook.com/docs/plugins/comments/
-> Click "Get Code"


# 5 > Add Comments #2 - Adding the code into your page

-> From the popup,
-> Step 1 - Follow the instructions ( Choose your App Id and Language)
-> Step 2 - If Not already created, Create element "facebook_head.ctp" in View->Elements->a 
                 copy the javascript code in Step2 and paste it in "facebook_head.ctp"


# 6 > Add Comments #3 - Adding the code into your page cont'd

 -> Create an element -  "facebook_comments.ctp"  in View->Elements->a
-> in facebook_comments.ctp page add the following code,

<?php if (!isset($pageUrl)) { $pageUrl = Router::url( $this->here, true ); } ?>
<div class="fb-comments" data-href="<?= $pageUrl; ?>" data-width="100%" data-numposts="10"</div>

->Pick the  Page you want to add the comment button and add the following 
<?= $this->Element('a/facebook_comments.ctp', array()); ?>

->Place the following code after the opening body tag in default layout
<?= $this->Element('a/facebook_head.ctp', array()); ?>


# 7 > Add Like Button #1 - Code Generator

Navigate to https://developers.facebook.com/docs/plugins/like-button/
-> Click "Get Code"


# 8 > Add Like Button #2 - Adding the code into your page

-> From the popup,
-> Step 1 - Follow the instructions ( Choose your App Id and Language)
-> Step 2 - If Not already created, Create element "facebook_head.ctp" in View->Elements->a 
                 copy the javascript code in Step2 and paste it in "facebook_head.ctp"


# 9 > Add Like Button #3 - Adding the code into your page cont'd

-> Create an element -  "facebook_like.ctp"  in View->Elements->a
-> in facebook_like.ctp page add the following code,
<?php if (!isset($pageUrl)) { $pageUrl = Router::url( $this->here, true ); } ?>
<div class="fb-like" data-href="<?= $pageUrl; ?>" data-layout="standard" data-action="like" data-size="large"
     data-show-faces="true" data-share="true">
</div>
->Pick the  Page you want to use with the like button and add the following 
<?= $this->Element('a/facebook_like.ctp', array()); ?>
->Place the following code afer the opening body tag in default layout
<?= $this->Element('a/facebook_head.ctp', array()); ?>


Other Instructions

Below are many other instructions that show you how to use your UpdateCase application