سؤال

لقد بدأت في استخدام المخططات من schema.org في رمز HTML الخاص بي وأعدت معرض صور (مقتطف أدناه). عندما لصق الكود الخاص بي في أداة اختبار البيانات منظمة من Google, ، لم أتلق أي أخطاء ، وبالتالي افترضت أن استخدام هذه المخططات كان مناسبًا ، لكنني ما زلت كذلك. فعلا؟

<figure itemscope itemtype="http://schema.org/ImageGallery">
  <figcaption itemprop="description">The castle through the ages: 1423, 1858, and 1999 respectively.</figcaption>
  <figure itemprop="image" itemscope itemtype="http://schema.org/ImageObject">
    <figcaption itemprop="caption">Etching. Anonymous, ca. 1423.</figcaption>
    <a href="castle1423.jpeg" itemprop="contentURL"> <img src="castle1423_thumb.jpeg" alt="The castle has one tower, and a tall wall around it." itemprop="thumbnailUrl"> </a> </figure>
  <figure itemprop="image" itemscope itemtype="http://schema.org/ImageObject">
    <figcaption itemprop="caption">Oil-based paint on canvas. Maria Towle, 1858.</figcaption>
    <a href="castle185.jpeg" itemprop="contentURL"> <img src="castle1858_thumb.jpeg" alt="The castle now has two towers and two walls." itemprop="thumbnailUrl"> </a> </figure>
  <figure itemprop="image" itemscope itemtype="http://schema.org/ImageObject">
    <figcaption itemprop="caption">Film photograph. Peter Jankle, 1999.</figcaption>
    <a href="castle1999.jpeg" itemprop="contentURL"> <img src="castle1999_thumb.jpeg" alt="The castle lies in ruins, the original tower all that remains in one piece." itemprop="thumbnailUrl"> </a> </figure>
</figure>
هل كانت مفيدة؟

المحلول

ال image منشأه من ImageGallery أ) يتوقع عنوان URL ، و B) على النحو التالي:

عنوان URL لصورة العنصر.

هكذا يقول ترميزك: "يمكن وصف ImageGallery بثلاث صور."؛ بينما ربما يجب أن تقول:"يتكون ImageGallery من ثلاث صور.".

حتى مع image يمكنك تحديد صورة يمكن استخدامها لتمثيل المعرض بأكمله.

لكل صورة من المعرض ، ربما يجب عليك استخدام associatedMedia منشأه (لكنني لست متأكدًا بنسبة 100 ٪ إذا حصلت على تعريفه بشكل صحيح ، "تشفير" يربكني هنا).

ترميز لكل منهما ImageObject تبدو جيدة بالنسبة لي.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top