Forum
Blog slug and URL shenanigans
I'm working with the blog in Perch Runway. I've set up all the templates for the listing page and detail pages and they are working great.
I have an issue getting the post URLs to play ball.
Current set up
Blog post page URL pattern
blog/[year:year]/[i:month]/[slug:s]
Blog settings Blog post page path
/blog/{postSlug}
Blog settings Slug format
%Y/%m/{postTitle}
With this set up, the URL is correct but when I visit the detail page, the post does not show up.
Alternative set up
Blog post page URL pattern
blog/[slug:s]
Blog settings Blog post page path
/blog/{postSlug}
Blog settings Slug format
{postTitle}
With this set up, I can view the blog post but the URL is not how I want it.
I'd like blog URLs to be in the format /blog/{year}/{month}/{postTitle}
In post.php I simply have
<?php perch_blog_post(perch_get('s')); ?>
Any idea what I am doing wrong?
Thanks
Can you show me the debug from the post page when it's not working?
Here you go...
That all looks like it's doing the right stuff. You say it just doesn't output the post?
That's right. This line outputs nothing..
From looking at the debug info. It seems that the 's' is equal to "hostpipe-are-rebranding-as-coconut" but the slug attached to the post (from the database as far as I can tell) is "2015/06/hostpipe-are-rebranding-as-coconut" which I assume is why it cannot find the post.
Any ideas?
Right, so you need to either add a token to match your entire slug in one go (see the "Post page routes" section on https://docs.grabaperch.com/addons/blog/runway-config/) or you need to pull the parts back together.
That did the trick. Thank you.