I have added microdata into every article manually and it works fine. Now I want to insert them into the latest articles module.
To override the module in my template and I added:
<li itemscope itemtype="https://schema.org/Article">
<span itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<span itemprop="name" content="...your organization name..."></span>
<span itemprop="logo" itemscope itemtype="https://schema.org/ImageObject">
<link itemprop="url" href="/images/KS.jpg">
<meta itemprop="width" content="50">
<meta itemprop="height" content="50">
</span>
</span>
<span itemprop="author" content="...your name..."></span>`
and it works for organization, organization image - logo and author.
Next I added:
<meta itemprop="datePublished" content="<?php echo JHtml::_('date', $item->publish_up, JText::_('Y-m-dTh:m:s')); ?> " >
and it works for published date.
Now I have a problem when I try to add articles image markup. I added:
<?php $images = json_decode($item->images); ?>
<span itemprop="image" itemscope itemtype="https://schema.org/ImageObject">
<link itemprop="url" href="<?php echo htmlspecialchars($images->image_intro); ?>" alt="<?php echo htmlspecialchars($images->image_intro_alt); ?>">
<meta itemprop="width" content="150">
<meta itemprop="height" content="100">
</span>
and it works fine, but only for intro images through article image and links tab. I have my images in my html (not in image and links tab) and I want to extract image url from html. I have more than 400 articles and I prefer to extract the images from the html.