I've got a blog listing channel set up where I'm trying to filter entries listed by the entries field blogAuthors
based on url segment.
/articles-and-excerpts/
loads the blog fine
added a route
but when I go to a page like this /articles-and-excperts/author/john-doe
I see errors until I add this to the template
{% if entry is not defined %}
{% set entry = craft.entries.section('blogListing').one() %}
{% endif %}
Then it works correctly. Why doesn't Craft recognize that this is the blogListing channel?
Also even though this works and displays the content SEOmatic doesn't recognize it now either.
Ultimately I need the following to load on this template:
/articles-and-excerpts/
/articles-and-excerpts/author/author.slug
/articles-and-excerpts/category/category.slug
/articles-and-excerpts/category/category.slug/author/author.slug
Currently I have categories using a separate template but haven't attempted to add in the author filtering.
Is there a better approach to this? I had started trying to combine url segments and a query string, but got stuck there as well Filtering entries by category and author channel