Now I have some post, they are in 3 categories.
fields:
category:
label: Category
type: select
options:
cat1: category1
cat2: category2
cat3: category3
How I visit these category with:
Can I just write one template page?
Now I have some post, they are in 3 categories.
fields:
category:
label: Category
type: select
options:
cat1: category1
cat2: category2
cat3: category3
How I visit these category with:
Can I just write one template page?
What you want to do is filter your post by category when calling a URL with that category. A category as such does not give you an URL. What you need is a route. The route would then return the parent page but with a filtered collection of posts, see “Returning a page with additional data for the template”.
Related example: Lowercase + dashes for param() helper URI
Note that with your options, instead of category1
you will save cat1
to file. You will have to keep this in mind when filtering your posts, e.g. use a category map. Or make sure from the beginning that you save the value you need for filtering.
Hope this helps.