Fix url for youtube

This commit is contained in:
Laurent Destailleur 2020-05-17 20:08:01 +02:00
parent 9370f71d01
commit 02d4ecb21c

View File

@ -582,14 +582,17 @@ function getStructuredData($type, $data = array())
"@type": "ContactPoint",
"contactType": "Contact",
"email": "'.dol_escape_json($mysoc->email).'"
},';
},'."\n";
if (is_array($mysoc->socialnetworks) && count($mysoc->socialnetworks) > 0) {
$ret .= '"sameAs": [';
$i = 0;
foreach($mysoc->socialnetworks as $key => $value) {
if ($key == 'linkedin') {
$ret.= '"https://www.'.$key.'.com/company/'.dol_escape_json($value).'"';
} else {
} elseif ($key == 'youtube') {
$ret.= '"https://www.'.$key.'.com/user/'.dol_escape_json($value).'"';
}
else {
$ret.= '"https://www.'.$key.'.com/'.dol_escape_json($value).'"';
}
$i++;