1. Newedge
  2. Thursday, 22 March 2018
Hello,
I'm facing a problem with Newedge template. When the news/articles are shared by the facebook share button, the images that are shown are not the ones from the article.

You may try it yourself: https://www.ajkerprosongo.com/
Responses (24)
Hi,
Thanks for your query. I saw, unfortunately, it shows the wrong URL while sharing the social media. Could you please pm me your admin access for my closer look and could fix it?

- Thanks
  1. more than a month ago
  2. Newedge
  3. # 1
Hi,
Please try now.
  1. more than a month ago
  2. Newedge
  3. # 2
Hello:

Can you please let me know if this was fixed and what you did? I have the same problem @ http://blogdigital.mx

Please advise.
  1. more than a month ago
  2. Newedge
  3. # 3
Hi,
Open the following file: /templates/shaper_newedge/html/com_content/article/default.php on 41 no line (before closing php tag) paste this code:


//get image
$article_attribs = json_decode($this->item->attribs);
$article_images = json_decode($this->item->images);
$article_image = '';
if(isset($article_attribs->spfeatured_image) && $article_attribs->spfeatured_image != '') {
$article_image = $article_attribs->spfeatured_image;
} elseif(isset($article_images->image_fulltext) && !empty($article_images->image_fulltext)) {
$article_image = $article_images->image_fulltext;
}

//opengraph
$document = JFactory::getDocument();
$document->addCustomTag('<meta property="og:url" content="'.JURI::current().'" />');
$document->addCustomTag('<meta property="og:type" content="article" />');
$document->addCustomTag('<meta property="og:title" content="'. $this->item->title .'" />');
$document->addCustomTag('<meta property="og:description" content="'. JHtml::_('string.truncate', $this->item->introtext, 155, false, false ) .'" />');
if ($article_image) {
$document->addCustomTag('<meta property="og:image" content="'. JURI::root().$article_image.'" />');
$document->addCustomTag('<meta property="og:image:width" content="600" />');
$document->addCustomTag('<meta property="og:image:height" content="315" />');
}


- Thanks
  1. more than a month ago
  2. Newedge
  3. # 4
Done, but the image on FB is still no the one from the article.

Any ideas?

Cheers



Hi,
Open the following file: /templates/shaper_newedge/html/com_content/article/default.php on 41 no line (before closing php tag) paste this code:


//get image
$article_attribs = json_decode($this->item->attribs);
$article_images = json_decode($this->item->images);
$article_image = '';
if(isset($article_attribs->spfeatured_image) && $article_attribs->spfeatured_image != '') {
$article_image = $article_attribs->spfeatured_image;
} elseif(isset($article_images->image_fulltext) && !empty($article_images->image_fulltext)) {
$article_image = $article_images->image_fulltext;
}

//opengraph
$document = JFactory::getDocument();
$document->addCustomTag('<meta property="og:url" content="'.JURI::current().'" />');
$document->addCustomTag('<meta property="og:type" content="article" />');
$document->addCustomTag('<meta property="og:title" content="'. $this->item->title .'" />');
$document->addCustomTag('<meta property="og:description" content="'. JHtml::_('string.truncate', $this->item->introtext, 155, false, false ) .'" />');
if ($article_image) {
$document->addCustomTag('<meta property="og:image" content="'. JURI::root().$article_image.'" />');
$document->addCustomTag('<meta property="og:image:width" content="600" />');
$document->addCustomTag('<meta property="og:image:height" content="315" />');
}


- Thanks
  1. more than a month ago
  2. Newedge
  3. # 5
Hi,
Please debug from here: https://developers.facebook.com/tools/debug/sharing/?q=https%3A%2F%2Fwww.blogdigital.mx%2Frecursos%2F119-negocio%2F243-realmente-tomas-en-serio-tu-sitio-web.html

- Thanks
  1. more than a month ago
  2. Newedge
  3. # 6
The image appears to be OK now. I rey-leaded the image again. However I still get this warning when debugging in FB:

The following required properties are missing: fb:app_id

Also, when I click on any go the social sharing icons the page simply scrolls to the top but no sharing pop-up appears.

Please advise.
  1. more than a month ago
  2. Newedge
  3. # 7
Hi,
I can see you have only Page Builder Regular License which only allows you to get support for SP Pagebuilder only.

- Thanks
  1. more than a month ago
  2. Newedge
  3. # 8
Really. It expired a few days ago.
  1. more than a month ago
  2. Newedge
  3. # 9
Hi Carlos Dieter,
Thanks for reactivated the license. Could you please pm me your admin access then i could fix it and i will send the code.

- Thanks
  1. more than a month ago
  2. Newedge
  3. # 10
Hello Rifat:

the admin is at http://blogdigital.mx/administrator/
User: joomshaper
Pwd: Stedica*2012

Cheers
  1. more than a month ago
  2. Newedge
  3. # 11
please try now.
  1. more than a month ago
  2. Newedge
  3. # 12
Not quite there yet.

I tested a random article and it is not correct

Please advise A349E37E-B16B-4475-BEBD-8DBADAED08AC.png
Attachments (1)
  1. more than a month ago
  2. Newedge
  3. # 13
Hi,
Thanks for the reply. You need to debug urls from facebook debugger. Because now the images showing from the cache.

Facebook Debugging URL: https://developers.facebook.com/tools/debug/

for test: https://www.blogdigital.mx/redes-sociales/221-4-recomendaciones-para-iniciar-tu-pyme-en-medios-sociales.html

- Thanks
  1. more than a month ago
  2. Newedge
  3. # 14
Will do.

Can you please let me know what file/ code you changed so I can backup this file and don't run into the same problem when I update the template?

Cheers
  1. more than a month ago
  2. Newedge
  3. # 15
Hi,
Thanks for your reply. I have worked on following file:
> templates/shaper_newedge/sppagebuilder/addons/latest_post/site.php
> templates/shaper_newedge/html/com_content/article/default.php


- Thanks
  1. more than a month ago
  2. Newedge
  3. # 16
Hi Rifat,

I have the same problem. Can you please help me. I tried to paste the code but it didn't solve my problem.

Please help.

Regards,
Filipe
  1. more than a month ago
  2. Newedge
  3. # 17
Hi,
Sorry for late reply. Could you please pm me your admin access then I could see the current situation and fix by myself.

- Thanks
  1. more than a month ago
  2. Newedge
  3. # 18
Hi Rifat,

It's solved, thanks.

Regards,
Filipe
  1. more than a month ago
  2. Newedge
  3. # 19
Hi Rifat
Let me know the change did you make in the files below. So i can implement it in my website, because i have the same issue. Thanks in advance
Hi,
Thanks for your reply. I have worked on following file:
> templates/shaper_newedge/sppagebuilder/addons/latest_post/site.php
> templates/shaper_newedge/html/com_content/article/default.php


- Thanks
  1. more than a month ago
  2. Newedge
  3. # 20
Hello,

Can you please let me know if this was fixed and what you did? I have the same problem @ http://portaldeti.com

Please advise.
  1. more than a month ago
  2. Newedge
  3. # 21
Hi Seidou Ndolumingo,
Thanks for the reply. First, i need to check your current code then i can give you the solution or i can fix it. If you can pm me your admin access then i can do it.

- Thanks
  1. more than a month ago
  2. Newedge
  3. # 22
Again Same Problem on Facebook Sharing
Attachments (1)
  1. more than a month ago
  2. Newedge
  3. # 23
Hi,
Open the following file: /templates/shaper_newedge/sppagebuilder/addons/latest_post/site.php on 162 to 174 no line you will get:

$output .= '<div class="sppb-post-share-social">';
$output .= '<a href="#" data-type="facebook" data-url="'. $_SERVER['SERVER_NAME'] . $item->link .'" data-title="'. $item->title .'" data-media="' . $image .'" class="prettySocial fa fa-facebook"></a>';

$output .= '<a href="#" data-type="twitter" data-url="'. $_SERVER['SERVER_NAME'] . $item->link .'" data-description="'. $item->title .'" data-media="' . $image .'" data-via="joomshaper" class="prettySocial fa fa-twitter"></a>';

$output .= '<a href="#" data-type="googleplus" data-url="'. $item->link .'" data-description="'. $item->title .'" data-media="' . $image .'" class="prettySocial fa fa-google-plus"></a>';

$output .= '<a href="#" data-type="pinterest" data-url="'. $item->link .'" data-description="'. $item->title .'" data-media="' . $image .'" class="prettySocial fa fa-pinterest"></a>';

$output .= '<a href="#" data-type="linkedin" data-url="'. $item->link .'" data-title="'. $item->title .'" data-description="'. $item->title .'" data-via="joomshaper" data-media="" class="prettySocial fa fa-linkedin"></a>';
$output .= '<div class="share-icon"><i class="fa fa-share-alt"></i></div>';
$output .= '</div>';


replace it by:


$root = JURI::base();
$root = new JURI($root);
$root_url = $root->getScheme() . '://' . $root->getHost();
$social_url = $root_url . $item->link;

// social share
$output .= '<div class="sppb-post-share-social">';
$output .= '<a href="javascript:void(0);" class="prettySocial fa fa-facebook" onClick="window.open(\'http://www.facebook.com/sharer.php?u=' . $social_url . '\',\'Facebook\',\'width=600,height=300,left=\'+(screen.availWidth/2-300)+\',top=\'+(screen.availHeight/2-150)+\'\'); return false;" href="http://www.facebook.com/sharer.php?u=' . $social_url . '"></a>';

$output .= '<a href="javascript:void(0);" class="prettySocial fa fa-twitter" onClick="window.open(\'http://twitter.com/share?url=' . $social_url . '&text=' . str_replace(" ", "%20", $item->title) . '\',\'Twitter share\',\'width=600,height=300,left=\'+(screen.availWidth/2-300)+\',top=\'+(screen.availHeight/2-150)+\'\'); return false;" href="http://twitter.com/share?url=' . $social_url . '&text=' . str_replace(" ", "%20", $item->title) . '"></a>';
$output .= '<a href="javascript:void(0);" class="prettySocial fa fa-pinterest" onClick="window.open(\'http://www.pinterest.com/pin/create/bookmarklet/?url=' . urlencode($social_url) . '&media='. $root_url . $image . '&is_video=false&description==' . urlencode($item->introtext) . '\',\'Pinterest\',\'width=585,height=666,left=\'+(screen.availWidth/2-292)+\',top=\'+(screen.availHeight/2-333)+\'\'); return false;" href="http://www.pinterest.com/pin/create/bookmarklet/?url=' . $social_url . '"></a>';

$output .= '<a href="javascript:void(0);" class="prettySocial fa fa-linkedin" onClick="window.open(\'http://www.linkedin.com/shareArticle?mini=true&url=' . $social_url . '\',\'Linkedin\',\'width=585,height=666,left=\'+(screen.availWidth/2-292)+\',top=\'+(screen.availHeight/2-333)+\'\'); return false;" href="http://www.linkedin.com/shareArticle?mini=true&url=' . $social_url . '"></a>';

$output .= '<div class="share-icon"><i class="fa fa-share-alt"></i></div>';
$output .= '</div>'; // END:: social share


- Thanks
  1. more than a month ago
  2. Newedge
  3. # 24


There are no replies made for this post yet.
Be one of the first to reply to this post!


This forum is archived

This forum has been archived. Please use JoomShaper official support system.