Don't like ads? PRO users don't see any ads ;-)

Fix open graph issue with K2 and OG protocol by Codeboxr

By: manchumahara on Jan 5th, 2013  |  syntax: PHP  |  size: 0.87 KB  |  hits: 61  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. //Go to(windows style path) joomla root\components\com_k2\views\item  , open file view.html.php  
  2. // and comment line from 445 to 455
  3. /*
  4. $document->setMetaData('og:url', $uri->toString());
  5.         $document->setMetaData('og:title', htmlspecialchars($document->getTitle(), ENT_QUOTES, 'UTF-8'));
  6.         $document->setMetaData('og:type', 'Article');
  7.         $facebookImage = 'image'.$params->get('facebookImage', 'Small');
  8.         if ($item->$facebookImage && JFile::exists(JPATH_SITE.$item->$facebookImage))
  9.         {
  10.             $image = substr(JURI::root(), 0, -1).str_replace(JURI::root(true), '', $item->$facebookImage);
  11.             $document->setMetaData('og:image', $image);
  12.             $document->setMetaData('image', $image);
  13.         }
  14.         $document->setMetaData('og:description', htmlspecialchars(strip_tags($document->getDescription()), ENT_QUOTES, 'UTF-8'));
  15.  
  16. */