Now I want to build a product model, and it belongs to multiple categories.
Can make a product belong to one page? Then use this page as a category.
For example in Kirby’s starterkit, can the photography/notes belong to one or more pages?
Now I want to build a product model, and it belongs to multiple categories.
Can make a product belong to one page? Then use this page as a category.
For example in Kirby’s starterkit, can the photography/notes belong to one or more pages?
I’m afraid I don’t really understand your question. Can you please try to rephrase it or give an example of what you want to achieve? Also, what is a model in your context? A Kirby page model?
Yes. Just like album.php and note.php in site/models in the root directory of StarterKit.
In my site, I want to show some products. They belong to several categories.
Ex:
categories1
product1
product2
product3
categories1
product4
product5
product6
Now I create 2 new pages, Named category 1 and category 2.
They are located at the root behind the homepage.
Then I enter the page called category 1, I want add product and looks like site’s root.
You probably want to create a new blueprint for the category pages, e.g. category.yml, in your site.yml you then have to create a new section for these categories, or include this template/blueprint in the existing pages section.
Now I added blueprint, then prompted an error.
my products.yml in blueprint/sections
type: pages
parent: kirby.page("products")
size: tiny
info: "{{ page.images.count }} image(s)"
layout: cards
template: product
empty: No product yet
image:
query: page.thumb
cover: true
ratio: 5/4
Could you also post the blueprint for this cooking page please?
And what is page.thumb? Is that a method defined in a model?