Blog-plugin: Doesn't work category filter

Created on 12 Sep 2016  路  2Comments  路  Source: rainlab/blog-plugin

plugin version 1.2.9

It seems that doesn't work category filter in the Post list component.
I used demo video as example. I created pages for blog, category and post entities.

  1. I have category with news-tag slug.
  2. I have page with URL /blog/category/:slug
  3. Post List component on this page has "Category filter" parameter :slug

Problems:

  • Result page (/blog/category/news-tag) display all posts instead displaying only "news-tag" posts.
  • Also I tried to do custom page with Post list component on it. The same result when I set "Category filter" parameter to /blog/category/news-tag.

What do I do wrong?

P.S. When I use xdebug to change value of variable categoryId from :slug to news-tag in the /plugins/rainlab/blog/components/Posts.php, method loadCategory() everything works correctly.

Most helpful comment

You are right.
Everything works. Thank you.

All 2 comments

Hi

Check out your post list component settings. The ">_" symbol should be on the left of ":slug", if it is on the right, click on it. When it's on the right - it's treated as a plain string value, when it's on the left - it is a parameter.

Or, if you are changing your settings in code, check out component settings section and make sure there is categoryFilter = "{{ :slug }}" instead of categoryFilter = ":slug" (for the same reason as above).

You are right.
Everything works. Thank you.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

willouch picture willouch  路  7Comments

drmzio picture drmzio  路  8Comments

nycparking picture nycparking  路  7Comments

petehalverson picture petehalverson  路  3Comments

sabuz picture sabuz  路  5Comments