Download
We're evolving to serve you better! This current forum has transitioned to read-only mode. For new discussions, support, and engagement, we've moved to GitHub Discussions.

[ Theme Dev ] Adding Custom Properties

#1851
Avatar photoBob

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 }}