Forum
Perch content not showing
Hey folks!
I need a bit of guidance. I updated my perch from 2.6.x to 2.8 a few weeks back, and it appeared pretty seamless. I had a quick check of a few pages on my site to ensure all was working and left it at that.
What I neglected to check was the actual blog post pages. Having taken a look this morning, my blog post pages aren't showing any content. The archives show the correct titles but clicking through to each post shows a page devoid of the blog post. An example is here > https://mrqwest.co.uk/blog/553/adventures-with-fullscreen
I've taken a look into the post.php template I use and this bit of code is meant to be pulling in the content but isn't.
<?php perch_blog_post(perch_get('s')); ?>
Am I calling that right?
What can I do to trouble shoot & fix this?
I've just followed the debug process mentioned here and here's my output: -
The Array at the bottom was highlighted in Red.
Are you on the latest version of Blog?
Yes Drew, or at least I think I am. 4.6 is the latest isn't it?
From Diagnostics:
Installed apps: content (2.8.4), assets (2.8.4), categories (2.8.4), perch_blog (4.6), perch_comments (1.1)
Is the above all of the debug output from the bottom of your page? If so, how is the slug being translated to postID 553 in your setup?
Drew, yes, that's the entire contents of the debug info. It's on my live site (trying to fix when I'm not at home) so the debug info is still shown on the page if you want to inspect > https://mrqwest.co.uk/blog/553/adventures-with-fullscreen
Under the blog settings, I've got this for a post slug >
/blog/{postID}/{postSlug}
Ok, great.
Did you update your
post.html
template when you updated last time?https://docs.grabaperch.com/addons/blog/installation/
Drew, I don't think I did but that's not the issue. I uploaded the new
post.html
file intoperch/templates/blog
and it's still not outputting the content.It works on other pages using
perch_blog_custom
... would it be easier to run with that?perch_blog_post()
usesperch_blog_custom()
under the hood, so if that works then go for it.You do need to make sure your post template is up to date though.
Thanks Drew...
I've taken a different approach. I noticed that the title was displaying correctly using
perch_blog_post_field(perch_get('s'), 'postTitle');
.So I replaced
perch_blog_post
withand it all works happily. I wonder what's different between these &
perch_blog_post()
.Obviously this works but isn't ideal. Any other thoughts on how I could retain use of the post.html template?
Have you now updated the
post.html
template, or does it still use legacy fields?