Créer des microdata imbriquées (hiérarchie d'éléments) avec des FieldGroup de plus de deux niveaux

More
7 years 2 months ago #66216 by 012abc
Ok, merci pour l'info. :)

J'ai d'autres priorités en fait.

J'ai lu aussi que Google recommondait JSON-LD pour le web sémantique (si je fais pas erreur).
"JSON-LD is the recommended format. Google is in the process of adding JSON-LD support for all markup-powered features. The table below lists the exceptions to this. We recommend using JSON-LD where possible."
developers.google.com/search/docs/guides...827812987&hl=fr&rd=1

Mais je ne vois pas comment implémenter JSON-LD avec Flexicontent. C'est peut-être un sujet pour rendre les contenus plus séduisants et améliorer l'expérience utilisateur avec les moteurs de recherche.

Please Log in or Create an account to join the conversation.

More
7 years 2 months ago #66325 by micker
en fait dans ton item.php tu peus charger les champs (regarde dans l'admin des template tu a des exeemple de code
<script type="application/ld+json">
{
"@context": " schema.org ",
"@type": "<?php echo lecodedetonchamptype ?>",
"url": "<?php echo lecodedetonchampurl ?>",
"contactPoint": [{
"@type": "ContactPoint",
"telephone": "+1-401-555-1212",
"contactType": "customer service"
}]
}
</script>

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

Please Log in or Create an account to join the conversation.

More
7 years 2 months ago - 7 years 2 months ago #66336 by 012abc
Dans la page source, il y a un "//" dans le "src" de l'image :
<img src="/images/stories/flexicontent//m_annonce-07032015-12.jpg" alt="Carburateur F/012 AMAC-AMAL" class="fc_field_image" itemprop="image">

Merci pour ton aide. :)
Last edit: 7 years 2 months ago by 012abc.

Please Log in or Create an account to join the conversation.

More
7 years 2 months ago - 7 years 2 months ago #66341 by 012abc
Google Search valide les JSON-LD créés avec le template modifier (index.php). Il trouve bien un type Product et un sous-type Offer.
Product
- Offer

Le seul truc, c'est que le JS apparaît dans le <body> et non dans le <head> de la page.
"Markup is placed inside a script tag in the head of the HTML page."

Pour mes microdatas créés avec les champs (field), c'est plus ambiguë pour les raisons indiquées précédemment.
Google Search valide, mais identifie deux types distincts : Offer et Product (au lieu de Product < Offer) avec une microdata qui n'est ni une url, ni un identifiant : "ID: http www.arbracam.org/content/89-boutique-terrot/flexicontent ."
Offer
Product

Avec les microdatas, j'ai créé une page événement en HTML dans un textarea. Google Search valide conformément au HTML ( www.arbracam.org/item/12296-bourse-motos...-%C3%A0-longvic.html ):
Event
- Location
- Offers
Pour la mise en page en revanche, c'est galère. Le modèle impose une certaine hiérarchie aux éléments qui ne correspond pas forcément à la forme que l'on veut présenter en frontend.

JSON-LD apparait préférable aux autres formats : "JavaScript notation separate from the body of the HTML itself." Même s'il a aussi ses propres limites.

Ce serait parfait si on pouvait remonter le JSON-LD généré par Flexicontent dans le <head>.

Je colle le JS pour qui veut s'en inspirer :
<script type="application/ld+json">
{
<?php
$html_img = $item->fields->display;
preg_match( '@src="([^"]+)"@' , $html_img, $match );
$src_img = array_pop($match);
?>
"@context": " schema.org/ ",
"@type": "Product",
"name": "<?php echo str_replace('"','',strip_tags($item->fields->display)); ?>",
"image": " www.arbracam.org ",
"description": "<?php echo str_replace('"','',strip_tags($item->fields->display)); ?>",
"offers": {
"@type": "Offer",
"url": " www.arbracam.org "priceCurrency": "<?php echo strip_tags($item->fields->display); ?>",
"price": "<?php echo strip_tags($item->fields->display); ?>",
"availability": "<?php echo strip_tags($item->fields->display); ?>"
}
}
</script>

Collé dans le index.php du template après le code :
// SEO
$microdata_itemtype = $this->params->get( 'microdata_itemtype');
$microdata_itemtype_code = $microdata_itemtype ? 'itemscope itemtype=" schema.org/'.$microdata_itemtype .'"' : '';
?>
Last edit: 7 years 2 months ago by 012abc.

Please Log in or Create an account to join the conversation.

More
7 years 2 months ago #66352 by micker
merci pour le retour
en fait tu peus passer cela dans le head mais avec de la programmation joomla
docs.joomla.org/Adding_JavaScript/fr

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

Please Log in or Create an account to join the conversation.

More
7 years 2 months ago - 7 years 2 months ago #66366 by 012abc
Merci. Mais je n'ai pas envie de monter une usine à gaz. C'est pas l'esprit d'un CMS.

J'ai fait un retour sur les microdatas qui dans certains cas peuvent faire la différence. Soit je m'y suis mal pris, soit il y a un sujet.
Last edit: 7 years 2 months ago by 012abc.

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.554 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline