Search…

X3 Photo Gallery Support Forums

Search…
 
Eightkiller
Experienced
Topic Author
Posts: 116
Joined: 15 Jul 2012, 14:34

When Sharing , how to redirect to the image inside its own gallery (not to a page with exif ...)

28 May 2017, 15:25

Hy,

When I share a picture on Facebook for example, I would like to be redirected to the picture inside its own gallery and not to a page where I have the image with its "full name" (xpiaodkjf.jpg) and all exif information. I didn't find how to configure it. Could you enlight me ?

You can see an explanation in this picture : 

Image

Thanks in advance.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13995
Joined: 30 Sep 2006, 03:37

Re: When Sharing , how to redirect to the image inside its own gallery (not to a page with exif ...)

29 May 2017, 00:39

The problem is, Facebook doesn't work like that. When sharing any page, FB will send it's robots over to the page, and get all data (preview image, title, description etc.). Therefore, the shared page needs to be a unique page for the image. Furthermore, if we add redirect (I tried this earlier), Facebook will FOLLOW the redirect, thus making it bypass the image-page and instead share the page where it redirects to ... It's not that strange really: Facebook wants to find out where the shared link "ENDS" for human visitors, so that it knows exactly what it's visitors are viewing/clicking.

Therefore, what you ask is not really possible.

At best, we could implement a javascript redirect after image-landing page loads, and try to avoid it from triggering for Facebook robots. It will still incur two page loads for the visitor. Hacky at best.
 
Eightkiller
Experienced
Topic Author
Posts: 116
Joined: 15 Jul 2012, 14:34

Re: When Sharing , how to redirect to the image inside its own gallery (not to a page with exif ...)

29 May 2017, 04:02

it could be a workaround indeed :) , but you have to admit it's weird for an anonymous visitor to see a picture with all EXIF information he does not care about and should not even see, instead of having a pleasant UI you desperately configured and only getting the HTML Gallery version :)

At least is it possible to remove all EXIF infos on this page or change the design to get close to the one in the gallery ?

I tried to changed some files without any success, i tried to modify exif_reader.php, exif_reader.bac and module.gallery.html 
Code
Changes in module.gallery.html

{% if myexif %}
 <p>{{myexif}}</p> <--- Removed this line to not show EXIF infos
{% endif %}
Code
Changes in exif_reader.php and .bac

$myexif = array(); //added by myself to remove EXIF at start
 // return array if not empty
return $myexif;
I cleared my explorer cache, maybe should I clear the server one ? Or should I restart my server?

It's quite an important topic, because if people start to share things on social networks, they will keep getting HTML Gallery pictures, and it will be the main way to access the pictures, instead of using the very nice X3 features that you worked so hard to create, thus the traffic on the website going in a way it was not intended to at start, killing the experience :s

Thanks in advance for your help.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13995
Joined: 30 Sep 2006, 03:37

Re: When Sharing , how to redirect to the image inside its own gallery (not to a page with exif ...)

29 May 2017, 05:00

Eightkill wrote:it could be a workaround indeed :) , but you have to admit it's weird for an anonymous visitor to see a picture with all EXIF information he does not care about and should not even see, instead of having a pleasant UI you desperately configured and only getting the HTML Gallery version :)
Perhaps, but have you tried the concept of "Sharing Images" from any other website? Like any other website, it will share a unique URL for the image specifically. When the link is opened, it will show THAT image. It can't possibly link to the parent gallery URL, simply because that is "wrong".

Even Facebook itself works like this. If I SHARE a link to an image (or open in new window, which is technically the same), the link will represent the image only, outside it's gallery context. Example:
Facebook Coca Cola image

Furthermore, there is actually a small bug in X3.22. But in new version X3.23.0, when a shared link is clicked in X3, the visitor will initially see the image in the POPUP. It would look like this:
Image
When visitor CLOSES the popup, it will naturally show the image-landing page, as any other website.
Eightkill wrote:At least is it possible to remove all EXIF infos on this page or change the design to get close to the one in the gallery ?
Easiest way to do that, panel > settings > custom > Custom CSS:
Code
.x3-file .meta {
  display: none;
}
Eightkill wrote:I tried to changed some files without any success, i tried to modify exif_reader.php, exif_reader.bac and module.gallery.html 
Templates in X3 are pre-rendered now, so that wouldn't work. Besides, it would be bad practice to edit template files that get overwritten on X3 updates.

I thought perhaps we had an option to disable EXIF on landing page, but now I'm not sure. Will check for new release coming soon ...
Eightkill wrote:It's quite an important topic, because if people start to share things on social networks, they will keep getting HTML Gallery pictures, and it will be the main way to access the pictures, instead of using the very nice X3 features that you worked so hard to create, thus the traffic on the website going in a way it was not intended to at start, killing the experience :s
Really no way to fix this though. The image landing page needs to be a unique page for the image, with unique page <title>image title/name</title> and text-content, which specifically represents the image. Not only for sharing, but for sake of SEO. We can't redirect it to the parent gallery page ... Even if we could hack it to redirect, that would involve tricking Facebooks robots to NOT follow the redirect. Facebook wants to know exactly WHERE a link goes to, so it uses humanized robots (with javascript) to find where a page redirects. We don't intend to implement features that try to do things that are not meant to be.

This is how any other website that shares IMAGES directly on Facebook operates.
 
Eightkiller
Experienced
Topic Author
Posts: 116
Joined: 15 Jul 2012, 14:34

Re: When Sharing , how to redirect to the image inside its own gallery (not to a page with exif ...)

29 May 2017, 10:25

Thanks for your answer mjau :)

Yes, I do understand it has to work like this, it's logical :) But unfortunately not user friendly :s

I'll hide the EXIF with CSS for now on waiting for the X23 version with the popup.

And perhaps could you give me a little custom CSS  to show the image a bit bigger (as it is in the popup or at least a bit bigger than it is in the actual HTML Gallery ?) or is it configurable inside the panel ?

See you soon on forum.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13995
Joined: 30 Sep 2006, 03:37

Re: When Sharing , how to redirect to the image inside its own gallery (not to a page with exif ...)

29 May 2017, 12:21

Eightkill wrote:And perhaps could you give me a little custom CSS  to show the image a bit bigger (as it is in the popup or at least a bit bigger than it is in the actual HTML Gallery ?) or is it configurable inside the panel ?
Sorry, the image uses the default X3 "narrow" layout, for a simple clean layout. Please wait for X3.23.0, and test the sharing with auto-popup. If you still need to change the width of the image in the landing page itself, I can help you after new X3 release when I'm not too busy.

PS! I assume you are aware that you can "share" image links directly like this: https://demo.photo.gallery/galleries/la ... &pid=hills ... Displays in popup, and in the context of the gallery that contains the image. Of course, this isn't really a unique "page" though, and Facebook will extract share meta-data from the page source, which is the parent gallery page. My only point, is that if you are sharing links around and it's crucial for you to focus on the image/gallery/context for the visitor, then this of course is the ultimate option.