I configured a blueprint called blog
which can have many sub-pages with the blueprint post
. Now I would like the sort order for posts withing the blog to be configurable with a field in the blog settings. This works fine in the frontend, but how can I do the same in the panel? I tried playing around with the sortBy
property, but it only accepts a string value, not something like a method defined on the model (blog.php).
So ideally, I would like the blog
section to look like this:
info: "{{ page.contentDetails }}"
type: pages
sortBy: page.sortOrder
templates:
- post
Where the sortOrder
field is defined as follows:
sortOrder:
default: published_desc
icon: funnel
label: Sort by
options:
manual: manual
title_asc: Title asc
title_desc: Title desc
modified_asc: Modified asc
modified_desc: Modified desc
published_asc: Published asc
published_desc: Published desc
type: select
width: 1/3
In this scenario, post
has a field published
as well.