Loading pages from collections dynamically #8501
-
Before using Statamic, I was using Blade views. And was getting the data from the database directly. Now I'd rebuild all views to work with Antlers and so far its great. What I just can't solve yet, is how to dynamically load a page, bases on the slug. I got a category-collection with pages. Every page is another category.
This will display every page, but I would like to only display the page for the category. For example the URL will match the slug of the page. Could this be a condition to just load that page? Or would there be a better option to solve this? The idea is that a webshop has many categories and the editors would like to change the banner for the category themselves. Probably the docs will explain something about my question, but I can't really solve it yet. If the docs are explaining this, where would that be? It would be nice if I could fix issues like this myself, with the help of the docs. :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
If I'm understanding, you are on a page like You can do something like this:
|
Beta Was this translation helpful? Give feedback.
If I'm understanding, you are on a page like
/foo/bar
and you want to filter that collection by the slug (bar
, maybe).You can do something like this: