Oj coś kręcisz
http://prntscr.com/vrvw3r
http://prntscr.com/vrvwm0
Tylko description jest widać na sztywno.
Najlepiej jest samemu dodać odpowiedni kod do widoku artykułu. Ja mam taki:
Kod PHP:
// Create shortcuts to some parameters.
include_once(JPATH_ROOT.'templates/'.$this->template.'/truncate.php');
$images = json_decode($this->item->images);
$totruncate = strip_tags($this->item->introtext);
$og_type = 'article';
$og_url = JURI::current();
if($images->image_intro) {
$og_obrazek = $images->image_intro;
} else {
$og_obrazek = 'templates/<moj-szablon>/images/default-cover.jpg';
}
$og_image = JRoute::_(JURI::root(false) . $og_obrazek);
$og_desc = limit_text($totruncate,400);
$og_title = $this->item->title;
$app =JFactory::getApplication();
$og_sitename = $app->getCfg('sitename');
$doc = JFactory::getDocument();
$doc->addCustomTag('<meta property="og:type" content="article"/>');
$doc->addCustomTag('<meta property="og:url" content="'.$og_url.'"/>');
$doc->addCustomTag('<meta property="og:site_name" content="'.$og_sitename.'"/>');
$doc->addCustomTag('<meta property="og:image" content="'.$og_image.'"/>');
$doc->addCustomTag('<meta property="og:description" content="'.$og_desc.'"/>');
$doc->addCustomTag('<meta property="og:title" content="'.$og_title.'"/>');
$doc->addCustomTag('<meta property="fb:app_id" content="1635986106673335"/>');
$doc->addCustomTag('<meta property="og:logo" content="'.JURI::root().'templates/'.$this->template.'/images/moje-logo.png'.'" size="320x320" />');
?>
Używam jeszcze jak widać pliku z funkcją do obcinania tekstu (pliku truncate.php:
Kod PHP:
<?php
defined( '_JEXEC' ) or die( 'Restricted index access' );
function limit_text($text, $chars = 25) {
$text = $text." ";
$text = substr($text,0,$chars);
$text = substr($text,0,strrpos($text,' '));
$text = $text."...";
return $text;
}
?>