Sign in

[ Theme Dev ] Adding Custom Properties

#1851
Bob

Hi Alfatreze,

I’m not sure I understood you correctly, but you can do it by “postConfig” options → https://getpublii.com/dev/theme-settings-api

e.g. config.json

"postConfig": [
{
"name": "displayDate",
"label": "Display date",
"value": 1,
"type": "select",
"options": [
{
"label": "Enabled",
"value": 1
},
{
"label": "Disabled",
"value": 0
}
]
}
],

and use it under the post.hbs file:

{{ @config.post.displayDate }}

or/and under posts listing :

{{ postViewConfig.displayDate }}

--
Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!