Forum

Thread tagged as: Problem, Runway, Blog

Draft links in runway

Hi

we have a customer that like to preview news items before they go live, with runway when you add routes for the post page news/[newsslug:s]

when you add a draft news item and try and preview it you get a 404 - page not found

/news/2015-03-02-test-post/preview

how do i add a route for the preview and where?

Regards,

Brett

Brett Warne

Brett Warne 0 points

  • 6 years ago

iu tried to add page news/[newsslug:s]/preview to the routes but then get a blank page

Rachel Andrew

Rachel Andrew 394 points
Perch Support

If you are getting a "blank page" then you have a PHP error. You need to make sure you either output errors to the screen or have access to your log while developing, so you can diagnose any issues you have.

There are no errors, I am getting the standard runway page not found. If I take the news item out of draft it works fine.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Does [preview:preview] make a difference?

as in news/[newsslug:s]/[preview:preview] That gives the news post page without the article.

Drew McLellan

Drew McLellan 2638 points
Perch Support

What does the debug output at that point?

Debug Message
SELECT p.pagePath, pr.routePattern, pr.routeRegExp, p.pageTemplate FROM perch2_pages p LEFT JOIN perch2_page_routes pr ON p.pageID=pr.pageID ORDER BY pr.routeOrder ASC
Using master page: /templates/pages/errors/404.php
Page arguments:

SELECT * FROM perch2_pages WHERE pagePath='/errors/404' LIMIT 1
SELECT regionKey, regionHTML FROM perch2_content_regions WHERE regionPage='/errors/404' OR regionPage='*' ORDER BY regionPage DESC
SELECT * FROM perch2_pages WHERE pagePath='/errors/404' LIMIT 1
Using template: /templates/pages/attributes/seo.html
SELECT * FROM perch2_pages WHERE pageNew=0 AND pageHidden=0 AND pageDepth >=0 AND pageDepth<=2 ORDER BY pageTreePosition ASC
SELECT pageTreePosition FROM perch2_pages WHERE pagePath='/errors/404' LIMIT 1
SELECT pageID FROM perch2_pages WHERE pageTreePosition IN ('000-002-001', '000-002', '000')
Using template: /templates/navigation/item.html
Time: 0.3098
Memory: 1.2365


here is the debug with the route added - news/[newsslug:s]/[preview:preview]

Debug Message
SELECT p.pagePath, pr.routePattern, pr.routeRegExp, p.pageTemplate FROM perch2_pages p LEFT JOIN perch2_page_routes pr ON p.pageID=pr.pageID ORDER BY pr.routeOrder ASC
Matched route: news/[newsslug:s]/[preview:preview]
Using master page: /templates/pages/news/post.php
Page arguments:

Array
(
    [0] => /news/2015-03-03-test-preview/preview
    [s] => 2015-03-03-test-preview
    [1] => 2015-03-03-test-preview
    [preview] => preview
    [2] => preview
)

SELECT * FROM perch2_pages WHERE pagePath='/news/post' LIMIT 1
SELECT regionKey, regionHTML FROM perch2_content_regions WHERE regionPage='/news/post' OR regionPage='*' ORDER BY regionPage DESC
SELECT * FROM perch2_pages WHERE pagePath='/news/post' LIMIT 1
Using template: /templates/pages/attributes/seo.html
SELECT * FROM perch2_pages WHERE pageNew=0 AND pageHidden=0 AND pageDepth >=0 AND pageDepth<=2 ORDER BY pageTreePosition ASC
SELECT pageTreePosition FROM perch2_pages WHERE pagePath='/news/post' LIMIT 1
SELECT pageID FROM perch2_pages WHERE pageTreePosition IN ('000-006-003', '000-006', '000')
Using template: /templates/navigation/item.html
SELECT SQL_CALC_FOUND_ROWS DISTINCT tbl.* FROM ( SELECT idx.itemID, main.*, idx2.indexValue as sortval FROM perch2_blog_index idx JOIN perch2_blog_posts main ON idx.itemID=main.postID AND idx.itemKey='postID' JOIN perch2_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='2015-03-03-test-preview')) AND idx.itemID=idx2.itemID AND idx.itemKey=idx2.itemKey GROUP BY idx.itemID ) as tbl WHERE (postStatus='Published' AND postDateTime<='2015-03-03 09:16:00' ) GROUP BY itemID ORDER BY sortval ASC LIMIT 0, 10
SELECT FOUND_ROWS() AS `count`
SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0
Using template: /templates/blog/post.html
SELECT groupID FROM perch2_navigation WHERE groupSlug='news' LIMIT 1
SELECT np.pageID, np.pageParentID, np.pageDepth, np.pageTreePosition FROM perch2_navigation_pages np, perch2_pages p WHERE p.pageID=np.pageID AND np.groupID=1 AND (p.pagePath='/news/post' OR p.pageSortPath='/news/post') LIMIT 1
SELECT pageID, pageParentID, pageDepth, pageTreePosition FROM perch2_navigation_pages WHERE groupID=1 AND pageID=0 LIMIT 1
SELECT np.pageID, np.pageParentID, p.pagePath, p.pageTitle, p.pageNavText, p.pageNew, p.pageOrder, np.pageDepth, p.pageSortPath, np.pageTreePosition, p.pageAccessTags, p.pageAttributes FROM perch2_navigation_pages np, perch2_pages p WHERE p.pageID=np.pageID AND np.groupID=1 AND p.pageNew=0 AND np.pageDepth >=0 AND np.pageDepth<=2 ORDER BY np.pageTreePosition ASC
SELECT np.pageTreePosition FROM perch2_pages p, perch2_navigation_pages np WHERE np.pageID=p.pageID AND np.groupID=1 AND p.pagePath='/news/post' LIMIT 1
Using template: /templates/navigation/news.html
Fetching from cache: perch_blog_categories589c7a634eb12f2ec225cfedc7dc78ae
Cache file not found: perch_blog_categories589c7a634eb12f2ec225cfedc7dc78ae
SELECT setID FROM perch2_category_sets WHERE setSlug='blog' LIMIT 1
SELECT main.* , COALESCE(cc.countValue,0) AS `count.blog.post` FROM perch2_categories main LEFT OUTER JOIN perch2_category_counts cc ON cc.catID=main.catID WHERE 1=1 AND setID='1' AND (cc.countType='blog.post' OR cc.countType IS NULL) AND cc.countValue > 0 ORDER BY catTreePosition ASC
Using template: /templates/blog/category_link.html
Caching: perch_blog_categories589c7a634eb12f2ec225cfedc7dc78ae
Fetching from cache: perch_blog_date_archive_monthsf2e7d49784704a5b24102a78c349d57c
Cache file not found: perch_blog_date_archive_monthsf2e7d49784704a5b24102a78c349d57c
SELECT year(postDateTime) as year, COUNT(*) AS year_qty FROM perch2_blog_posts WHERE postStatus='Published' AND postDateTime<='2015-03-03 09:16:00' GROUP BY year ORDER BY year DESC
SELECT DISTINCT year(postDateTime) AS year, month(postDateTime) AS month, CONCAT(year(postDateTime),"-",month(postDateTime),"-01") AS postDateTime, COUNT(*) AS month_qty FROM perch2_blog_posts p WHERE year(postDateTime) = '2015' AND p.postStatus='Published' AND p.postDateTime<='2015-03-03 09:16:00' GROUP BY year, month ORDER BY month DESC
Using template: /templates/blog/months_month_link.html
SELECT DISTINCT year(postDateTime) AS year, month(postDateTime) AS month, CONCAT(year(postDateTime),"-",month(postDateTime),"-01") AS postDateTime, COUNT(*) AS month_qty FROM perch2_blog_posts p WHERE year(postDateTime) = '2014' AND p.postStatus='Published' AND p.postDateTime<='2015-03-03 09:16:00' GROUP BY year, month ORDER BY month DESC
Using template: /templates/blog/months_month_link.html
Using template: /templates/blog/months_year_link.html
Caching: perch_blog_date_archive_monthsf2e7d49784704a5b24102a78c349d57c
Time: 0.5123
Memory: 1.3406

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, that looks good. I'll see if I can debug it at this end.

Any news on this? got the same problem

Rachel Andrew

Rachel Andrew 394 points
Perch Support

Dexter, please post as a new thread full details of your problem including Diagnostic Report.