Jump to content

cant put facebook in displayLeftColumn


Recommended Posts

By default Facebook does not have Left Hook so you need to add one to the .php file within the module.

 

modules/blockfacebook/blockfacebook.php

 

Make some space and add this at or around line 94:

 

public function hookLeftColumn()
{
if (!$this->isCached('blockfacebook.tpl', $this->getCacheId()))
$this->context->smarty->assign('facebookurl', Configuration::get('blockfacebook_url'));
 
return $this->display(__FILE__, 'blockfacebook.tpl', $this->getCacheId());
}
 
 
 
 
After this I had issues with the module displaying correctly in the left column so I changed a few more things.
 
Edit the blockfacebook.tpl file and change the <div> tag at line 28 as below.
 
(changed ID as to not change the cmsinfo block css)
<div id="facebook_block_fan" class="block">  
 
Now edit the global.css file and at or around line 7864 you will find the #facebook_block, cmsinfo_block lines, I removed the facebook_block, from each of these changed the #facebook_block, .facebook_fanbox as below.
 
#facebook_block_fan .facebook-fanbox {
  background: white;
  border: 1px solid #aaaaaa;
  padding-bottom: 10px; 
  width:270px   {*not necassary except for center column*}
  }
 
 
 
 
 
Global.css should look like this when done: lines - 7865-7888
 
 
#cmsinfo_block {
  overflow: hidden;
  background: #f2f2f2;
  min-height: 344px;
  padding-right: 29px;
  padding-left: 29px; }
  @media (max-width: 991px) {
    
    #cmsinfo_block {
      min-height: 348px;
      padding-left: 13px;
      padding-right: 13px; } }
  @media (max-width: 767px) {
   
    #cmsinfo_block {
      width: 100%;
      min-height: 1px; } }
 
#facebook_block_fan .facebook-fanbox {
  background: white;
   padding-bottom: 10px; 
  width:270px
  }
 
If you want the border add      border: 1px solid #aaaaaa;  to above.
 
 
 
 
 
Now go to the BO Modules, Positions and transplant the Facebook block to the DisplayLeftColumn and unhook from the DisplayHome.
 
 
 
You can see the results here:
 
Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

I did exactly as you showed below and it shows perfectly on the left, but the facebook block only shows at homepage. 

If I click on product details, there is only a title "follow us on facebook", but nothing else. Not sure where the problem is from.

Thanks

Kent

 

 

By default Facebook does not have Left Hook so you need to add one to the .php file within the module.

 

modules/blockfacebook/blockfacebook.php

 

Make some space and add this at or around line 94:

 

public function hookLeftColumn()
{
if (!$this->isCached('blockfacebook.tpl', $this->getCacheId()))
$this->context->smarty->assign('facebookurl', Configuration::get('blockfacebook_url'));
 
return $this->display(__FILE__, 'blockfacebook.tpl', $this->getCacheId());
}
 
 
 
 
After this I had issues with the module displaying correctly in the left column so I changed a few more things.
 
Edit the blockfacebook.tpl file and change the <div> tag at line 28 as below.
 
(changed ID as to not change the cmsinfo block css)
<div id="facebook_block_fan" class="block">  
 
Now edit the global.css file and at or around line 7864 you will find the #facebook_block, cmsinfo_block lines, I removed the facebook_block, from each of these changed the #facebook_block, .facebook_fanbox as below.
 
#facebook_block_fan .facebook-fanbox {
  background: white;
  border: 1px solid #aaaaaa;
  padding-bottom: 10px; 
  width:270px   {*not necassary except for center column*}
  }
 
 
 
 
 
Global.css should look like this when done: lines - 7865-7888
 
 
#cmsinfo_block {
  overflow: hidden;
  background: #f2f2f2;
  min-height: 344px;
  padding-right: 29px;
  padding-left: 29px; }
  @media (max-width: 991px) {
    
    #cmsinfo_block {
      min-height: 348px;
      padding-left: 13px;
      padding-right: 13px; } }
  @media (max-width: 767px) {
   
    #cmsinfo_block {
      width: 100%;
      min-height: 1px; } }
 
#facebook_block_fan .facebook-fanbox {
  background: white;
   padding-bottom: 10px; 
  width:270px
  }
 
If you want the border add      border: 1px solid #aaaaaa;  to above.
 
 
 
 
 
Now go to the BO Modules, Positions and transplant the Facebook block to the DisplayLeftColumn and unhook from the DisplayHome.
 
 
 
You can see the results here:
 

 

Link to comment
Share on other sites

I tried this and the whole homepage is not displaying at all.

Thanks

Kent

 

Try getting rid of caching

public function hookLeftColumn()
{

$this->context->smarty->assign('facebookurl', Configuration::get('blockfacebook_url'));
 
return $this->display(__FILE__, 'blockfacebook.tpl');
}
 
Link to comment
Share on other sites

Thank you! I might just follow Vekia's suggestion as I have no knowledge of coding. 

PS: Your free module of Q&A seems not so compatible with PS1.6.6. 

enable error reporting as described in my signature, to see what the error is (might be the missing $params in the method)

Link to comment
Share on other sites

Thanks [spam-filter]!

I tried your free module, which is good. Yet I dont know how to do further modification. Like I want to change "Find us on facebook" to "FOLLOW US ON FACEBOOK". If the header can be same style as PS1.6 will be perfect. 

 

 

hello

instead of modifications of default module, just use one of the free likebox modules,

these addons have much more customization options

and works in left column without modifications.

Link to comment
Share on other sites

×
×
  • Create New...