Forum

Thread tagged as: Problem, Runway, Blog

Runway blog issue with Categories and Tags

Have installed and successfully set up most the the blog app within runway using this tutorial - https://docs.grabaperch.com/addons/blog/runway/config/

Have routing sorted for categories and tags but have noticed if I have a Category called 'News' and then tag an item as 'News' the category link disappears from archive options.

If I have 2 blog items in News category and flag ONLY ONE with a tag of News then I get both Categories and Tags links in archive nav.

If I then add the 'News' tag to the second item, in other words all items are in Category 'News' and have been tagged with 'News', the categories option disappears.

If I then remove the 'news' tag from one of the blog items and re-save then i once again get both archive filter options.

Am I doing something wrong here?

Also on another issue I am unsure what to change to get the 'More posts' link to work. It appears on the index page under the latest blog items list. It is set to /blog/archive.php by default. I get 'page not found' when clicked, assume it should load a page show more posts but unsure how to set up and it is not mentioned in the documentation i don't think.

Thanks again for help.

Keith Winter

Keith Winter 0 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

I'm finding this hard to follow. Are archive options, archive nav and archive filter all part of your page? Or are you referring to something in the control panel?

Sorry Drew and thanks for weekend response.

Issue is with the page, Am using the included index, archive and post templates etc downloaded with the app.

have configured successfully the following routes -

blog/[slug:s]/[preview:preview]
blog/[blogslug:s]
blog/[year:year]
blog/[year:year]/[i:month]
blog/category/[slug:cat]
blog/tag/[slug:tag]

Updated links in the index and archive templates eg.

<a href="/blog/category/<perch:category id="catSlug" type="slug" for="catTitle" order="2" />">

I have 2 issues -

  1. On the index template under the recent posts output is a link - 'More posts'
<a href="archive.php">More posts</a>

I am uncertain what to do with this link and route to get this to list more posts on the archive page. Sorry if I am missing something obvious here.

  1. I have 2 test posts in the blog. I have one category - News.

Both posts are in the News category.

If I add a TAG 'News' to both posts I no longer see the link on the archive page to the Category 'News' list. I only have the link to the TAG list on the archive page.

<h3>Tags</h3>
<ul>
<li><a href="/blog/tag/news" rel="tag">News (2)</a></li>
</ul>

If I remove the TAG 'News' from just ONE of the posts then I get both links - to category list and tag list.

<h3>Categories</h3>
<ul>
<li><a href="/blog/category/news">News (2)</a></li>
</ul>

<h3>Tags</h3>
<ul>
<li><a href="/blog/tag/news" rel="tag">News (2)</a></li>
</ul>

Unsure if I have something wrong or this is expected behaviour.

Hope that is clearer. Thanks

Drew McLellan

Drew McLellan 2638 points
Perch Support

On the index template under the recent posts output is a link - 'More posts'

Those sample pages are primarily aimed at Perch users, so you'll want to update the links in the templates for Runway. What's the location of your archive page? You should be able to just update the link in the templates to point to that page.

Ah ok Drew thanks, error on my part, thought the page would work with and without the .php suffix. I had changed a good few of the links in the templates for Runway config. /blog/archive works. Sorry.

And the issue of 'News' category link not showing when posts have TAG 'News'?

cheers. Keith

Drew McLellan

Drew McLellan 2638 points
Perch Support

What does debug output at that point?

Hi Drew

Have noticed that when both test posts in category 'News' have a tag added 'News' the category 'News' link disappears from both index page and archive page.

blog index.php page debug -

Debug Message
[22] SELECT p.pagePath, pr.routePattern, pr.routeRegExp, p.pageTemplate FROM sqhc_pages p LEFT JOIN sqhc_page_routes pr ON p.pageID=pr.pageID ORDER BY pr.routeOrder ASC, p.pagePath ASC
Matched page: /blog, so not using routes.
Using master page: /templates/pages/blog/index.php
[1] SELECT * FROM sqhc_pages WHERE pagePath='/blog' LIMIT 1
Using template: /templates/pages/attributes/default.html
Using sub-template: /templates/pages/attributes/seo.html
[9] SELECT * FROM sqhc_pages WHERE pageNew=0 AND pageHidden=0 ORDER BY pageTreePosition ASC
[1] SELECT pageTreePosition FROM sqhc_pages WHERE pagePath='/blog' LIMIT 1
[1] SELECT pageID FROM sqhc_pages WHERE pageTreePosition IN ('000-006', '000') ORDER BY pageTreePosition DESC
Using template: /templates/navigation/item.html
[3] Using template: /templates/navigation/item2.html
[5] Using template: /templates/navigation/item2.html
[2] SELECT SQL_CALC_FOUND_ROWS DISTINCT tbl.* FROM ( SELECT idx.itemID, main.*, idx2.indexValue as sortval FROM sqhc_blog_index idx JOIN sqhc_blog_posts main ON idx.itemID=main.postID AND idx.itemKey='postID' JOIN sqhc_blog_index idx2 ON idx.itemID=idx2.itemID AND idx.itemKey='postID' AND idx2.indexKey='postDateTime' WHERE 1=1 AND idx.itemID=idx2.itemID AND idx.itemKey=idx2.itemKey ) as tbl WHERE (postStatus='Published' AND postDateTime<='2016-12-04 23:12:00' ) GROUP BY itemID, sortval ORDER BY sortval DESC LIMIT 0, 10
[1] SELECT FOUND_ROWS() AS `count`
[24] SELECT DISTINCT settingID, settingValue FROM sqhc_settings WHERE userID=0
[2] Using template: /templates/blog/post_in_list.html
[1] SELECT * FROM sqhc_blog_sections ORDER BY sectionTitle ASC
[1] SELECT * FROM sqhc_blogs ORDER BY blogTitle ASC
Fetching from cache: perch_blog_categories589c7a634eb12f2ec225cfedc7dc78ae
Cache file not found: perch_blog_categories589c7a634eb12f2ec225cfedc7dc78ae
[1] SELECT setID FROM sqhc_category_sets WHERE setSlug='blog' LIMIT 1
[nil] SELECT main.* , COALESCE(cc.countValue,0) AS `count.blog.post` FROM sqhc_categories main LEFT OUTER JOIN sqhc_category_counts cc ON cc.catID=main.catID WHERE 1=1 AND setID=4 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
Fetching from cache: perch_blog_tagse0b2ff59ed95ac2a35516ee8013c2dd2
Fetching from cache: perch_blog_date_archive_years06b1ec41355f83614225087b92313523
Fetching from cache: perch_blog_date_archive_monthsf2e7d49784704a5b24102a78c349d57c
[2] SELECT regionKey, regionHTML FROM sqhc_content_regions WHERE regionPage='/blog' OR regionPage='*' ORDER BY regionPage DESC
[1] SELECT groupID FROM sqhc_navigation WHERE groupSlug='footer-nav' LIMIT 1
[3] 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 sqhc_navigation_pages np, sqhc_pages p WHERE p.pageID=np.pageID AND np.groupID=3 AND p.pageNew=0 ORDER BY np.pageTreePosition ASC
[0] SELECT np.pageTreePosition FROM sqhc_pages p, sqhc_navigation_pages np WHERE np.pageID=p.pageID AND np.groupID=3 AND p.pagePath='/blog' LIMIT 1
[3] Using template: /templates/navigation/footer-item.html
[1] SELECT pageID, pageParentID, pageDepth, pageTreePosition FROM sqhc_pages WHERE pagePath='/blog' OR pageSortPath='/blog' LIMIT 1
[1] SELECT * FROM sqhc_pages WHERE pageID=0 LIMIT 1
[5] SELECT * FROM sqhc_pages WHERE pageNew=0 AND pageHidden=0 AND pageDepth >=0 AND pageDepth<=1 ORDER BY pageTreePosition ASC
[1] SELECT pageTreePosition FROM sqhc_pages WHERE pagePath='/blog' LIMIT 1
[1] SELECT pageID FROM sqhc_pages WHERE pageTreePosition IN ('000-006', '000') ORDER BY pageTreePosition DESC
Request time: 0.2396
Process time: 0.233
Memory: 5.0702

Thanks Keith

Drew McLellan

Drew McLellan 2638 points
Perch Support

When you're adding the tag, is it in the same process as assigning the category, or are you doing it separately?

I am doing it separately. Both posts are already assigned to category 'News'. I am editing the TAG entries on their own. Thanks

Drew McLellan

Drew McLellan 2638 points
Perch Support

What happens when you do it in one action?

Ok Drew I added the TAG 'News' in Meta and Social tab then went back to the Post tab for that blog item and re-saved (with category 'News' selected) This fixed the issue. Odd!