Sign in

Post config options

  • This topic has 2 replies, 2 voices, and was last updated 2 years ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #3702
    Avatar photobtrem

    Do post config options work in theme overrides? I tried to add a field to posts in blank-override/config.json :

    "postConfig": [
            "name": "scientificName",
            "label": "Scientific name:",
            "placeholder": "Enter scientific name of plant",
            "value": "",
            "type": "text"

    I entered text in the “Scientific name” text box in the post editor.

    I added elements in my front page index.hbs :

    {{#each posts}}
    <article class="plant">
            {{! post title }}
            {{! /post title }}
            <p class="scientificName">{{}}</p>


    <article class="plant">
            <p class="scientificName"></p>


    Avatar photoBob

    Hi btrem,

    Everything is fine except one thing: because you are trying to use post config options outside the post page you have to use the postViewConfig object and that’s exactly what you did, but the syntax is wrong, do not use at sign (@):

    <div class="scientificName">{{postViewConfig.scientificName}}</div>

    more in this topic: and

    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!

    Avatar photobtrem

    Thanks, that did it.

    (And I’ll work on my apparently poor copy/paste skills.)

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Post config options’ is closed to new replies.