xoops forums

Zap_English

Quite a regular
Posted on: 6/13 8:30
Zap_English
Zap_English (Show more)
Quite a regular
Posts: 391
Since: 2016/5/24
#1

Publisher Images on Facebook

XOOPS Version XOOPS 2.5.9-Beta2
PHP Version 7.0.33
mySQL Version 5.5.65-MariaDB
Publisher 1.02 beta 3

I noticed that when I share to FB the shareaholic popup shows the image attached to the publisher article

but when it's posted to FB it just shows our main logo with a description beside it.

And it's only on one website. two others work fine

liomj

Just popping in
Posted on: 6/13 12:45
liomj
liomj (Show more)
Just popping in
Posts: 36
Since: 2012/4/10
#2

Re: Publisher Images on Facebook

Hi
you can try inserting this code in root/themes/themename/theme.html before </head> if that helps

<{if $xoops_dirname == "publisher"}>  
        <
meta property="og:type" content="website" />
        <
meta property="og:title" content="<{$item.title}>" />
        <
meta property="og:description" content="<{$item.summary}>" />
        <
link rel="image_src" href="<{$item.image_path}>" />  
        <
meta property="og:image" content="<{$item.image_path}>"/> 
        <
meta property="og:image:type" content="image/jpeg" />
        <
meta property="og:image:width" content="1200" />
        <
meta property="og:image:height" content="628" />
        <
meta property="og:url" content="<{$item.itemurl}>"/>  
        <
meta itemprop="image" content="<{$item.image_path}>"/>  
        <
link rel="canonical" href="<{$item.itemurl}>"/>   
    <{/if}>

heyula

Theme Designer
Posted on: 6/13 13:54
heyula
heyula (Show more)
Theme Designer
Posts: 487
Since: 2008/4/24
#3

Re: Publisher Images on Facebook

Schema example for TDMDownloads

Resized Image


Demo: https://indir.top/
Resized Image

heyula

Theme Designer
Posted on: 6/13 13:59
heyula
heyula (Show more)
Theme Designer
Posts: 487
Since: 2008/4/24
#4

Re: Publisher Images on Facebook

other examples
<{if $smarty.server.REQUEST_URI|strstr:'indir/singlefile.php'}> 
        <{* 
adding social meta tagsFacebook *}>
        <
meta property="og:url" content="<{$xoops_url}>/indir/singlefile.php?lid=<{$lid}>"/>
        <
meta property="og:title" content="<{$xoops_pagetitle}>"/>
        <
meta property="og:description" content="<{$xoops_meta_description}>"/>
        <
meta property="og:type" content="article"/>
        <
meta property="og:image" content="<{$logourl}>"/>  
        
        <{* 
adding social meta tagsTwitter *}>
        <
meta name="twitter:url" content="<{$xoops_url}>/indir/singlefile.php?lid=<{$lid}>"/>
        <
meta name="twitter:card" content="summary"/>
        <
meta name="twitter:title" content="<{$xoops_pagetitle}>"/>
        <
meta name="twitter:description" content="<{$xoops_meta_description}>"/>
        <
meta name="twitter:image" content="<{$logourl}>"/>
        <{/if}>
        
        <{if 
$SCRIPT_NAME == "/index.php"}>
        <{* 
adding social meta tagsFacebook *}>
        <
meta property="og:url" content="https://indir.top/"/>
        <
meta property="og:title" content="<{$xoops_pagetitle}>"/>
        <
meta property="og:description" content="<{$xoops_meta_description}>"/>
        <
meta property="og:type" content="article"/>
        <
meta property="og:image" content="https://indir.top//themes/indir/images/logo.png"/>  
        
        <{* 
adding social meta tagsTwitter *}>
        <
meta name="twitter:url" content="https://indir.top/"/>
        <
meta name="twitter:card" content="summary"/>
        <
meta name="twitter:title" content="<{$xoops_pagetitle}>"/>
        <
meta name="twitter:description" content="<{$xoops_meta_description}>"/>
        <
meta name="twitter:image" content="https://indir.top//themes/indir/images/logo.png"/>
        
        <
meta name="rating" content="<{$xoops_meta_rating}>"/>
        <
meta name="author" content="<{$xoops_meta_author}>"/>
        <
meta name="copyright" content="<{$xoops_meta_copyright}>"/>
        <
meta name="generator" content="XOOPS"/>
        <{/if}>

Mamba

Moderator
Posted on: 6/13 14:30
Mamba
Mamba (Show more)
Moderator
Posts: 10991
Since: 2004/4/23
#5

Re: Publisher Images on Facebook

You need to check out what are the differences between those installations.

We use here Publisher 1.07 Final, and we don't have any problems - every time when I post a link to an article here, Facebook is fetching the picture from here without any problem.

Because two websites are working fine, then obviously something has to be different on the third one...
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

Zap_English

Quite a regular
Posted on: 6/13 19:50
Zap_English
Zap_English (Show more)
Quite a regular
Posts: 391
Since: 2016/5/24
#6

Re: Publisher Images on Facebook

the one that isn't working is a newer site.

I pretty sure I had to add some code to the other two to gt FB to accept/display the proper image, but I don't remember what. I was a few years ago

Zap_English

Quite a regular
Posted on: 6/13 19:55
Zap_English
Zap_English (Show more)
Quite a regular
Posts: 391
Since: 2016/5/24
#7

Re: Publisher Images on Facebook

[quote]
liomj wrote:
Hi
you can try inserting this code in root/themes/themename/theme.html before </head> if that helps


Unfortunately that code didn't do anything