Forum

Thread tagged as: Question, Problem

Gallery OG Image

The fix to the issue I had pulling out a gallery image to use for social sharing here seems not to be working anymore since updating the Gallery app. The image path is now being output in the page head with a break before the final quotation mark like so...

<meta property="og:image" content="https://dev1.pixelsmiths.co.uk/perch/resources/bluebell-woods-new-w1100.jpg
" />

Header code

$sharing_image = perch_gallery_album_images(perch_get('s'), array(
'template' =>'sharing-image.html',
'count' => 1,
), true);

PerchSystem::set_var('sharing_image',$sharing_image);

Attributes file code...

<meta property="og:image" content="<perch:pages id="domain" /><perch:pages id="sharing_image" />" />

Diagnostics

Perch: 3.0.8, PHP: 7.0.20, MySQL: 5.5.32, with PDO
Server OS: Linux, cgi-fcgi
Installed apps: content (3.0.8), assets (3.0.8), categories (3.0.8), jw_activity_log (1.0.1), perch_blog (5.5.1), perch_forms (1.9), perch_gallery (2.8.9)
App runtimes: <?php $apps_list = [ 'perch_forms', 'perch_gallery', 'perch_blog', ];
PERCH_LOGINPATH: /perch
PERCH_PATH: /home/pixelsmi/public_html/clients/dev1/perch
PERCH_CORE: /home/pixelsmi/public_html/clients/dev1/perch/core
PERCH_RESFILEPATH: /home/pixelsmi/public_html/clients/dev1/perch/resources
Image manipulation: GD
PHP limits: Max upload 128M, Max POST 128M, Memory: 768M, Total max file upload: 128M
F1: 0c66c2e1f82f9e0b7617b2cb8270f2c7
Resource folder writeable: Yes
HTTP_HOST: dev1.pixelsmiths.co.uk
DOCUMENT_ROOT: /home/pixelsmi/public_html/clients/dev1
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php

Any ideas?

Mark Phoenix

Mark Phoenix 0 points

  • 4 years ago

Turns out that removing the new line the Atom text editor adds at the end from my sharing-image.html template has fixed it.

Drew McLellan

Drew McLellan 2638 points
Perch Support

That sounds right. Perch preserves any whitespace in your templates.