Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • Grzegorz Laski Friend
    #846533

    Hi, I check few articles in google Structure Data Testing Tool. I can’t set few requaired schema like : headline, image, publisher and mainEntityOfPage.

    Can you help me with that.

    My website http://www.polskatradycja.pl

    Ninja Lead Moderator
    #847354

    Hi,

    I checked on your site and saw your site is missing some meta tags below

    author: missing and required
    headline:   missing and required
    image:  missing and required
    name:   missing and required
    publisher:  missing and required
    mainEntityOfPage:   missing and recommended

    You can have a look at the guide with meta tags and apply it into both files

    
    templates/ja_teline_v/html/layouts/joomla/content/item/topic.php
    templates/ja_teline_v/html/layouts/joomla/content/item/default.php
    <div itemscope itemtype="http://schema.org/NewsArticle">
      <meta itemscope itemprop="mainEntityOfPage"  itemType="https://schema.org/WebPage" itemid="https://google.com/article"/>
      <h2 itemprop="headline">Article headline</h2>
      <h3 itemprop="author" itemscope itemtype="https://schema.org/Person">
        By <span itemprop="name">John Doe</span>
      </h3>
      <span itemprop="description">A most wonderful article</span>
      <div itemprop="image" itemscope itemtype="https://schema.org/ImageObject">
        <img src="https://google.com/thumbnail1.jpg"/>
        <meta itemprop="url" content="https://google.com/thumbnail1.jpg">
        <meta itemprop="width" content="800">
        <meta itemprop="height" content="800">
      </div>
      <div itemprop="publisher" itemscope itemtype="https://schema.org/Organization">
        <div itemprop="logo" itemscope itemtype="https://schema.org/ImageObject">
          <img src="https://google.com/logo.jpg"/>
          <meta itemprop="url" content="https://google.com/logo.jpg">
          <meta itemprop="width" content="600">
          <meta itemprop="height" content="60">
        </div>
        <meta itemprop="name" content="Google">
      </div>
      <meta itemprop="datePublished" content="2015-02-05T08:00:00+08:00"/>
      <meta itemprop="dateModified" content="2015-02-05T09:20:00+08:00"/>
    </div>

    Besides that, I forwarded this problem to the development team. They will check and fix it next version.

    Regards

    Grzegorz Laski Friend
    #848116

    It’s almost done, but I still need help.

    I add – itemprop="image" – and now SDTT want to add itemprop for size <meta itemprop="width" content=""> <meta itemprop="height" content=""> I can’t find where I should add this ?

    Furthermore I have no idea how can I use mainEntityOfPage – can you help me?

    Regards

    Ninja Lead Moderator
    #848242

    You can’t use width and height meta tags but you want to do, you can add it into image tab from templates/ja_teline_v/html/layouts/joomla/content/image/image.php file

    About to use mainEntityOfPage you can add it with from into title article from plugins/system/t3/base-bs3/html/layouts/joomla/content/item_title.php file with form

    <a itemprop="mainEntityOfPage" href="<?php echo $url ?>"><?php echo $this->escape($item->title); ?></a>

    Hope it helps

    Grzegorz Laski Friend
    #851653

    MainEntityOfPage works fine but still I have two problems.

    1. Where Can I add meta tags for publisher

    2. I’m not sure where exactly should I add meta tags for width and height.
    $item = $displayData['item'];
    $params = $displayData['params'];
    $title_tag = $displayData['title-tag'];
    $canEdit = $params->get('access-edit');
    if (empty ($item->catslug)) {
      $item->catslug = $item->category_alias ? ($item->catid.':'.$item->category_alias) : $item->catid;
    }
    $url = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catslug));
    $uri = JUri::getInstance();
    $prefix = $uri->toString(array('scheme', 'host', 'port'));
    ?>
    
    <header class="article-header clearfix">
        <<?php echo $title_tag; ?> class="article-title" itemprop="name">
            <?php if ($params->get('link_titles')) : ?>
                <a itemprop="mainEntityOfPage" href="<?php echo $url ?>" itemprop="url" title="<?php echo $this->escape($item->title); ?>">
                    <?php echo $this->escape($item->title); ?></a>
            <?php else : ?>
                <?php echo $this->escape($item->title); ?>
                <meta itemprop="url" content="<?php echo $prefix.$url ?>" />
            <?php endif; ?>
        </<?php echo $title_tag; ?>>
    
        <?php if ($item->state == 0) : ?>
            <span class="label label-warning"><?php echo JText::_('JUNPUBLISHED'); ?></span>
        <?php endif; ?>
        <?php if (strtotime($item->publish_up) > strtotime(JFactory::getDate())) : ?>
            <span class="label label-warning"><?php echo JText::_('JNOTPUBLISHEDYET'); ?></span>
        <?php endif; ?>
        <?php if ((strtotime($item->publish_down) < strtotime(JFactory::getDate())) && $item->publish_down != '0000-00-00 00:00:00') : ?>
            <span class="label label-warning"><?php echo JText::_('JEXPIRED'); ?></span>
        <?php endif; ?>
    </header>
    
    Ninja Lead Moderator
    #854960

    Hi
    You can take a look on the steps given below :

    • Open templates/ja_teline_v/html/layouts/joomla/content/image/image.php file

    Find

    <img <?php echo $caption ?> src="<?php echo htmlspecialchars($img); ?>" alt="<?php echo htmlspecialchars($alt); ?>" itemprop="thumbnailUrl"/>

    and add script below after it

    <meta itemprop="width" content="800">
    <meta itemprop="height" content="800">
    • About publisher tag, open templates/ja_teline_v/html/layouts/joomla/content/info_block/blog_block.php file, you will see the way to add itemprop="datePublished" tag
    <time datetime="<?php echo JHtml::_('date', $displayData['item']->publish_up, 'c'); ?>" itemprop="datePublished">

    Let me know if it helps .

    Grzegorz Laski Friend
    #863124

    Image size and datePublished works good.

    But still I need Publisher. Please looka at this code. I add this into
    ROOT/templates/ja_teline_v/html/layouts/joomla/content/item/default.php
    but publisher.logo doesn’t work.

    Check this article in Google SDTT
    http://www.polskatradycja.pl/top-10/festiwale-folkowe.html

        <meta itemprop="publisher" content="PolskaTradycja">
        <meta itemprop="publisher.logo" content="http://www.polskatradycja.pl/images/banners/nowe-logo.png">
        <meta itemprop="publisher.logo.url" content="http://www.polskatradycja.pl/images/banners/nowe-logo.png">
        <meta itemprop="publisher.logo.height" content="50">
        <meta itemprop="publisher.logo.width" content="150">
    Ninja Lead Moderator
    #863243

    You can try to replace your code on this post with my code below

    <div itemprop="publisher" itemscope itemtype="https://schema.org/Organization">
    Grzegorz Laski Friend
    #863494

    It works greate.
    Thx a lot

    Ninja Lead Moderator
    #863498

    Yes, I am very glad to help you out. Now, I will close this thread. If you have any further assistance, please don’t hesitate to contact us.

Viewing 10 posts - 1 through 10 (of 10 total)

This topic contains 9 replies, has 2 voices, and was last updated by  Ninja Lead 8 years, 3 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum