Forum
Blog slug doesn't contain a date
I've set up my blog and have created a page to show individual posts in Perch Runway. The problem is that they date isn't being prepended to the slug.
In Perch Runway settings I have:
Blog post page path: /blog/{postSlug}
Slug format: %Y-%m-%d-{postTitle}
My routes for the post display page are:
blog/[slug:s]
blog/[slug:s]/[preview:preview]
In the portion of diagnostics related to the blog I see:
perch_blog_update: 5.6
perch_blog_post_url: /blog/{postSlug}
perch_blog_site_name: Ovia Health Resources & Research
perch_blog_slug_format: %Y-%m-%d-{postTitle}
And yet, no date is being appended to the slug, so posts with the same name aren't unique.
My debug message is:
Debug Message - Perch Runway 3.1.1
[29] SELECT p.pagePath, pr.routePattern, pr.routeRegExp, p.pageTemplate, pr.routeOrder, s.settingValue AS siteOffline FROM perch3_pages p LEFT JOIN perch3_page_routes pr ON p.pageID=pr.pageID LEFT JOIN perch3_settings s ON s.settingID='siteOffline' UNION SELECT NULL AS pagePath, pr2.routePattern, pr2.routeRegExp, pr2.templatePath AS pageTemplate, pr2.routeOrder, NULL AS siteOffline FROM perch3_page_routes pr2 WHERE templateID!=0 ORDER BY routeOrder ASC, pagePath ASC
Matched route: blog/[slug:s]
Using master page: /templates/pages/blog/post.php
Page arguments:
Array
(
[0] => /blog/infertility-and-patient-focused-care
[s] => infertility-and-patient-focused-care
[1] => infertility-and-patient-focused-care
)
[34] SELECT DISTINCT settingID, settingValue FROM perch3_settings WHERE userID=0
[1] SELECT SQL_CALC_FOUND_ROWS DISTINCT tbl.* FROM ( SELECT idx.itemID, main.*, idx2.indexValue as sortval FROM perch3_blog_index idx JOIN perch3_blog_posts main ON idx.itemID=main.postID AND idx.itemKey='postID' JOIN perch3_blog_index idx2 ON idx.itemID=idx2.itemID AND idx.itemKey='postID' AND idx2.indexKey='_id' WHERE 1=1 AND ((idx.indexKey='postSlug' AND idx.indexValue='infertility-and-patient-focused-care')) AND idx.itemID=idx2.itemID AND idx.itemKey=idx2.itemKey GROUP BY idx.itemID, idx2.indexValue, postID ) as tbl WHERE (postStatus='Published' AND postDateTime<='2018-05-16 19:18:00' ) GROUP BY itemID, sortval ORDER BY sortval ASC LIMIT 0, 10
[1] SELECT FOUND_ROWS() AS `count`
[1] Using template: /templates/blog/meta_head.html
[9] SELECT * FROM perch3_blog_authors ORDER BY authorFamilyName, authorGivenName ASC
[1] SELECT * FROM perch3_blog_sections ORDER BY sectionTitle ASC
[2] SELECT * FROM perch3_blogs ORDER BY blogTitle ASC
[34] SELECT DISTINCT settingID, settingValue FROM perch3_settings WHERE userID=0
[2] SELECT regionKey, regionHTML FROM perch3_content_regions WHERE regionPage='/blog/post' OR regionPage='*' ORDER BY regionPage DESC
[1] SELECT blogID FROM perch3_blogs WHERE blogSlug='blog' LIMIT 1
[1] SELECT SQL_CALC_FOUND_ROWS DISTINCT tbl.* FROM ( SELECT idx.itemID, main.*, idx2.indexValue as sortval FROM perch3_blog_index idx JOIN perch3_blog_posts main ON idx.itemID=main.postID AND idx.itemKey='postID' JOIN perch3_blog_index idx2 ON idx.itemID=idx2.itemID AND idx.itemKey='postID' AND idx2.indexKey='_id' WHERE 1=1 AND ((idx.indexKey='postSlug' AND idx.indexValue='infertility-and-patient-focused-care')) AND idx.itemID=idx2.itemID AND idx.itemKey=idx2.itemKey GROUP BY idx.itemID, idx2.indexValue, postID ) as tbl WHERE ( blogID=1 AND postStatus='Published' AND postDateTime<='2018-05-16 19:18:00' ) GROUP BY itemID, sortval ORDER BY sortval ASC LIMIT 0, 10
[1] SELECT FOUND_ROWS() AS `count`
[1] Using template: /templates/blog/post.html
Using sub-template: /templates/content/blocks/blog/text_block.html
Using sub-template: /templates/content/blocks/blog/text-over-3-links.html
Using sub-template: /templates/content/blocks/blog/pullquote.html
Using sub-template: /templates/content/blocks/blog/full-width-image.html
I tried adding a custom token, as in the Perch Runway Blog instructions, but that didn't help.
I feel like I'm missing something very obvious, but have been staring at it for far too long.
Have you created a post since changing the slug format?
Yes, no date. I'm truly puzzled.
Can you give an example of the title and the slug value you're getting as a result?
I just created a post titled "Just one more test". The slug value that I'm getting is "/blog/just-one-more-test".
Can you post your diagnostics report?
Sure, here you go:
That looks fine. Does the post date otherwise save correctly? Can you display it in the template?
Yes, the post date displays in the template using the field id "postDateTime".
Do I need to add a custom token in the runway.config?
No, that's only for specifying routes, not generating the slug.
Weird. Really weird.