Answer the question
In order to leave comments, you need to log in
How to properly configure open graph for correct display?
I'm trying to write a CRM system. It has a task section. When a user copies a link to a specific task and pastes it into any messenger (in my case, Discord), the wrong thing is displayed. I read that open graph is for Facebook, but it doesn't display correctly there either.
HTML:
<html lang="en" xmlns:og="http://ogp.me/ns#">
<head>
<meta charset="utf-8" />
<title><?=$title?> | <?=$site['name']?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta content="<?=$description?>" name="description" />
<meta property="og:title" content="<?=$og_title?>" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://<?=$site_url?>" />
<meta property="og:site_name" content="название компании" />
<meta property="og:image" content="http://domen.ua/template/assets/images/logo_sm.png" />
<!--подключение стилей-->
</head>
public function actionView($id) {
$title = 'Просмотр задачи - ' . $task[0]['NAME'];
$site_url = $site['url'] . $_SERVER['REQUEST_URI'];
$og_title = $task[0]['NAME'];
$description = $task[0]['NAME'];
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question