Community @ The Turning Gate

Support community for TTG plugins and products.

NOTICE

The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.

This forum is now closed, and exists here as a read-only archive.

  • New user registrations are disabled.
  • Users cannot create new topics.
  • Users cannot reply to existing topics.

You are not logged in.

#1 2015-05-26 15:21:36

john bishop images
Moderator
From: Vancouver, BC, Canada
Registered: 2012-10-05
Posts: 20
Website

Update pages-gallery breaks social media links

I'm using Pages for my home page and have recently updated it using Lr Publisher using a Stage fullscreen-flip gallery template. Now the home page no longer contains proper links for the image sources in the social media links.

For example ...
<link rel="image_src" href="http://johnbishopimages.com/photos/Full-Bloom-0389_v1.jpg"/> should now point to
<link rel="image_src" href="http://johnbishopimages.com/galleries/pages-gallery/photos/Full-Bloom-0389_v1.jpg"/>

Likewise these are also bad ...
<meta property="og:image" content="http://johnbishopimages.com/photos/Full-Bloom-0389_v1.jpg"/>
<meta name="twitter:image" value="http://johnbishopimages.com/photos/Full-Bloom-0389_v1.jpg"/>
<meta name="twitter:image:src" value="http://johnbishopimages.com/photos/Full-Bloom-0389_v1.jpg"/>

Note that prior to replacing the home page gallery for the first time, the links are OK. But once updated using Publisher, the links no  longer point to the right place so this breaks Twitter cards, etc.

I've had to jerry-rig this by FTP copying the new updated images to the old referenced location (/photos/) and things work OK. Note that the old images are left behind as are the thumbnails but for my purposes that doesn't seem to be a problem. It might be for other gallery types.

John
;-j

Offline

#2 2015-05-27 17:02:34

Matthew
Administrator
From: San Francisco, CA
Registered: 2012-09-24
Posts: 5,795
Website

Re: Update pages-gallery breaks social media links

Ah, probably due to .htaccess hyjinx getting the page URL ... the gallery actually exists in /galleries, but is being used at / ... off the top of my head, I'm not sure. Will have to think on it, or maybe talk to Ben. It's a bit of a tricky thing we're doing, allowing publisher to take over the Home page.


Matt

The Turning Gate, http://theturninggate.net

Offline

#3 2015-05-30 09:50:24

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Update pages-gallery breaks social media links

Hi John, this requires a code change in the generated templates, and hence an update to the web plugins.  We have some working code to solve this.  If you'd like to try it out in advance, the changes are to the template_index.php and template_mobile.php.

Substituting all occurrences of:

<?php echo currentPageLocation(); ?>/photos

With:

<?php echo $album->getURL(); ?>photos

Note that the slash following the closing ?> is removed in the new code, as it's already provided by the getURL() function.

Offline

#4 2015-05-31 09:05:23

john bishop images
Moderator
From: Vancouver, BC, Canada
Registered: 2012-10-05
Posts: 20
Website

Re: Update pages-gallery breaks social media links

Hi Ben,

I've updated my 3 ttg-be templates (1 CE4 Gallery and 2 variants of CE4 Stage), 4 lines in each and that seems to have fixed the problem. However  I also find 4 occurrences of the same string inside the CE4 Gallery template_single.php file. Shouldn't this be updated as well?

;-j

Offline

#5 2015-05-31 17:13:15

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Update pages-gallery breaks social media links

Hi John,  I'm glad that solved it.  There's no need to change the code in template_single.php, other than for coding consistency.  The single pages should open in the location of the gallery, e.g. http://yoursite.com/galleries/pages-gal … oto01.php, so don't suffer from the broken social media links in the same way that the home page gallery does.

Offline

Board footer

Powered by FluxBB