I use the subpages of the homepage to create categories.
my product page blueprint:
Note that text and value are different.
fields:
category:
label: category
type: select
options: query
query:
fetch: site.find('home').children
text: "{{ page.title }}"
value: "{{ page.slug }}"
Now in my product template, I can get category’s slug by $page->category(), But I want to show this page’s category title.
<a href="<?= $page->parent()->url(['params' => ['category' => $page->category()]]) ?>"><?= how to show category's title ?></a>