Viewing 4 posts - 16 through 19 (of 19 total)
  • Author
    Posts
  • Saguaros Moderator
    #756711

    Hi

    We override the com_content to support OG tag, you can try with this tweak:

    – Open this file: root/templates/ja_magz_ii/html/com_content/article/default.php (remember to backup the old file first)

    – At approx line 40, at below snippet of code:


    JHtml::_('bootstrap.tooltip');

    // Add Facebook tags
    $doc = JFactory::getDocument();
    $fblog = '<meta property="og:type" content="article" />'."n";
    $fblog .= '<link rel="image_src" content="'.JUri::base().$images->image_fulltext.'" />'."n";
    $fblog .= '<meta property="og:image" content="'.JUri::base().$images->image_fulltext.'" />'."n";
    if($this->item->tags->itemTags != null){
    $this->item->rawtagLayout = new JLayoutFile('joomla.content.rawtags');
    $fblog .= '<meta property="article:tag" content="'.$this->item->rawtagLayout->render($this->item->tags->itemTags).'" />'."n";
    }
    $doc->addCustomTag($fblog);

    it looks like this: http://prntscr.com/971oxy

    I also attach this file here so that you can make a comparison

    emilioh Friend
    #758717

    Its very close

    Im using: – Phoca Open Graph Plugin and Al Plugin Face Comment

    1. if I use the share botton, just pick up the image an the error, with the correct option on as first chose

    2. If I copy and paste the link, happens the same as the 1 option.

    Saludos

    dannyblaq Friend
    #758783

    <em>@Saguaros 504034 wrote:</em><blockquote>Hi

    We override the com_content to support OG tag, you can try with this tweak:

    – Open this file: root/templates/ja_magz_ii/html/com_content/article/default.php (remember to backup the old file first)

    – At approx line 40, at below snippet of code:


    JHtml::_('bootstrap.tooltip');

    // Add Facebook tags
    $doc = JFactory::getDocument();
    $fblog = '<meta property="og:type" content="article" />'."n";
    $fblog .= '<link rel="image_src" content="'.JUri::base().$images->image_fulltext.'" />'."n";
    $fblog .= '<meta property="og:image" content="'.JUri::base().$images->image_fulltext.'" />'."n";
    if($this->item->tags->itemTags != null){
    $this->item->rawtagLayout = new JLayoutFile('joomla.content.rawtags');
    $fblog .= '<meta property="article:tag" content="'.$this->item->rawtagLayout->render($this->item->tags->itemTags).'" />'."n";
    }
    $doc->addCustomTag($fblog);

    it looks like this: http://prntscr.com/971oxy

    I also attach this file here so that you can make a comparison</blockquote>

    I tried this and nothing happens.

    Not sure why it is so difficult to add OpenGraph meta tags in the header?

    Where are the images declared? Should be able to dynamically populate the large image.

    Saguaros Moderator
    #758787

    KIndly check the article you want to share and make sure that you add images for article via ‘Images and Links‘ tab: http://prntscr.com/98jfpa

Viewing 4 posts - 16 through 19 (of 19 total)

This topic contains 19 replies, has 4 voices, and was last updated by  Saguaros 8 years, 11 months ago.

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