Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for category filtering in Categories component #27

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

RomainMazB
Copy link
Contributor

Fix #26

Comment on lines +56 to +61
'categoryFilter' => [
'title' => 'winter.blog::lang.settings.posts_filter',
'description' => 'winter.blog::lang.settings.posts_filter_description',
'default' => '{{ :slug }}',
'type' => 'string',
],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RomainMazB three comments here:

  • I think the name categoryFilter is probably not accurate for what we are doing. Instead, this should probably be rootCategory, as technically we are specifying a root category to start nesting from.
  • I think those lang strings might be incorrect?
  • Should the default perhaps be blank so that the original functionality is maintained?

$categoriesQuery->where('slug', $slug);
}

$categories = $categoriesQuery->first()->getChildren();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RomainMazB I'd recommend we continue nesting with getNested here, and leave it up to the template whether to display the full nested structure underneath the root category, or just simply show the direct children.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for category filtering in Categories component
2 participants