Download

Posts dropdown

The posts dropdown can be used for situations where you want to allow users of your theme to use a specific relation to the given post.

It can be used e.g., to specify the privacy policy page:

 
{
     "name": "privacyPolicyPage",
     "label": "Privacy Policy",
     "group": "GDPR",
     "value": "",
     "allowedPostStatus": ["any"],
     "type": "posts-dropdown",
     "multiple": false
}
Posts dropdown list

The posts dropdown returns the ID/s of the selected post/s as a value, so it should be connected with the use of the getPost or getPosts helper. If the multiple option is set to true, then a string with IDs separated by commas is returned.

The allowedPostStatus parameter allows the following values:

  • any
  • draft
  • hidden
  • featured
  • published
  • excluded

The any value means any other post status, so there is no need to specify any other statuses in the array with post statuses values.

What are you waiting for?

Start building your site today.

  1. 1 Download Publii
  2. 2 Write your content
  3. 3 Publish your site
Create website