Fix json-ld file
This commit is contained in:
parent
729cc4fd6f
commit
d3ac33ce20
@ -533,8 +533,9 @@ function includeContainer($containerref)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return HTML content to add structured data for an article, news or Blog Post.
|
* Return HTML content to add structured data for an article, news or Blog Post.
|
||||||
|
* Use the json-ld format.
|
||||||
*
|
*
|
||||||
* @param string $type 'blogpost', 'product', 'software'...
|
* @param string $type 'blogpost', 'product', 'software', 'organization', ...
|
||||||
* @param array $data Array of data parameters for structured data
|
* @param array $data Array of data parameters for structured data
|
||||||
* @return string HTML content
|
* @return string HTML content
|
||||||
*/
|
*/
|
||||||
@ -575,13 +576,13 @@ function getStructuredData($type, $data = array())
|
|||||||
$ret .= '{
|
$ret .= '{
|
||||||
"@context": "https://schema.org",
|
"@context": "https://schema.org",
|
||||||
"@type": "Organization",
|
"@type": "Organization",
|
||||||
"name": "'.dol_escape_json($companyname).'",
|
"name": "'.dol_escape_json($data['name'] ? $data['name'] : $companyname).'",
|
||||||
"url": "'.$url.'",
|
"url": "'.dol_escape_json($data['url'] ? $data['url'] : $url).'",
|
||||||
"logo": "/wrapper.php?modulepart=mycompany&file=logos%2F'.urlencode($mysoc->logo).'",
|
"logo": "'.($data['logo'] ? dol_escape_json($data['logo']) : '/wrapper.php?modulepart=mycompany&file=logos%2F'.urlencode($mysoc->logo)).'",
|
||||||
"contactPoint": {
|
"contactPoint": {
|
||||||
"@type": "ContactPoint",
|
"@type": "ContactPoint",
|
||||||
"contactType": "Contact",
|
"contactType": "Contact",
|
||||||
"email": "'.dol_escape_json($mysoc->email).'"
|
"email": "'.dol_escape_json($data['email'] ? $data['email'] : $mysoc->email).'"
|
||||||
},'."\n";
|
},'."\n";
|
||||||
if (is_array($mysoc->socialnetworks) && count($mysoc->socialnetworks) > 0) {
|
if (is_array($mysoc->socialnetworks) && count($mysoc->socialnetworks) > 0) {
|
||||||
$ret .= '"sameAs": [';
|
$ret .= '"sameAs": [';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user