Forum

Thread tagged as: Problem, Blog

Blog 5.0 upgrade, Open Graph output incomplete

I've upgraded to Blog 5.0 with Perch 2.8.15 on local dev server. All posts were imported and the Meta and Social tab in the admin is populated. However, using the meta_head.html template on my pages, some information is not output in the page code. The og:title, og:description and corresponding Twitter attributes don't have values.

If I save the post (from the Meta and Social tab page), the values are output. But, posts that haven't been resaved don't. This would seem to mean that I need to resave all posts. Which wouldn't be ideal!

Not sure if this is a bug or something weird with my site.

Short diagnostics

Perch: 2.8.15, PHP: 5.4.4, MySQL: mysqlnd 5.0.10 - 20111026 - $Id: b0b3b15c693b7f6aeb3aa66b646fee339f175e39 $, with PDO
Server OS: WINNT, apache2handler
Installed apps: content (2.8.15), assets (2.8.15), categories (2.8.15), perch_blog (5.0), perch_forms (1.8.2)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_blog', 'perch_forms', ); //include(PERCH_PATH.'/core/apps/content/runtime.php'); //include(PERCH_PATH.'/addons/apps/perch_blog/runtime.php'); //include(PERCH_PATH.'/addons/apps/perch_comments/runtime.php'); ?>
PERCH_LOGINPATH: /perch
PERCH_PATH: C:\Users\Clive Walker\OneDrive\Documents\Websites\Websites E-L\Horsham Pub\perch
PERCH_CORE: C:\Users\Clive Walker\OneDrive\Documents\Websites\Websites E-L\Horsham Pub\perch\core
PERCH_RESFILEPATH: C:\Users\Clive Walker\OneDrive\Documents\Websites\Websites E-L\Horsham Pub\perch\resources
Image manipulation: GD
PHP limits: Max upload 8M, Max POST 8M, Memory: 128M, Total max file upload: 8M
Resource folder writeable: Yes
HTTP_HOST: horshampub.local
DOCUMENT_ROOT: C:/Users/Clive Walker/OneDrive/Documents/Websites/Websites E-L/Horsham Pub
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
Clive Walker

Clive Walker 22 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

We can't output those values if you've not yet entered them :)

If you don't go to the Meta tab and add the data, there's nothing to output.

Oh! I misunderstood the import process. I assumed that importing blog posts and seeing the data in admin meant 'saved'.

For a blog with a lot of posts, is there any quick way of saving all posts?

Oh, wait, I can do this. Use <perch:if> to check for og_title. If that's available, output it and og_description. If not, use postTitle and excerpt instead. That gives me data for historic posts.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Sorry, which import process? Are you importing from WordPress?

No, sorry, by 'import', I meant the Blog 5 upgrade process where posts are updated after login/software update.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok. So all that's happened with the new fields is that you now have some new fields you can fill in. When you first edit them, if they have no value already we attempt to pre-fill them from the title and excerpt as a time saver. But fundamentally if you've not added content for those fields then they don't have content.

OK, no problem. I misunderstood the pre-filled values and their status. I'll use a conditional in my template.