Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Allow boolean choice to provide a string value #158

Closed
apowell656 opened this issue Oct 23, 2021 · 5 comments
Closed

Enhancement: Allow boolean choice to provide a string value #158

apowell656 opened this issue Oct 23, 2021 · 5 comments
Labels
enhancement New feature or request
Milestone

Comments

@apowell656
Copy link
Sponsor

apowell656 commented Oct 23, 2021

The draft status in Pelican is not a boolean, but a string. I have removed the default boolean option, but I really the toggle would be a great option.

Having an option/choice for the boolean to provide a string opposed to true/false would be a great solve. This would make the dashboard actually useful when looking for "In draft" articles.

@apowell656 apowell656 changed the title Allow boolean choice to provide a string value Enhancement: Allow boolean choice to provide a string value Oct 23, 2021
@estruyf
Copy link
Owner

estruyf commented Oct 25, 2021

Sounds like a good functionality to improve.

Might have to introduce a new setting for this in order to specify what field to use. So that the dashboard can check its type.

@estruyf estruyf added the enhancement New feature or request label Oct 25, 2021
@estruyf
Copy link
Owner

estruyf commented Oct 25, 2021

Hi @apowell656,

The first implementation is completed.

In order for it to work, you need to do the following steps:

  • Specify the new frontMatter.content.draftField setting, with for instance the following configuration:
"frontMatter.content.draftField": {
  "name": "draft",
  "type": "choice",
  "choices": ["draft", "in progress", "published"]
}
  • In the content type, specify the field type to use for the draft field to draft instead of boolean.
  • Once both steps are completed, the dashboard will show tabs with the different specified choices, and instead of a toggle, it will show a dropdown.

@estruyf
Copy link
Owner

estruyf commented Oct 25, 2021

You are now able to test it out in the beta version.

@estruyf estruyf added this to the 5.3.0 milestone Oct 25, 2021
@apowell656
Copy link
Sponsor Author

@estruyf this works great! Thank you for adding this enhancement.

@estruyf
Copy link
Owner

estruyf commented Oct 25, 2021

Thanks @apowell656 for verifying!

estruyf added a commit that referenced this issue Oct 27, 2021
@estruyf estruyf mentioned this issue Oct 28, 2021
@estruyf estruyf closed this as completed Oct 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants