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

ENH Auto-scaffold blog categories and tags formfields #769

Merged

Conversation

GuySartorelli
Copy link
Member

See post-implementation note in the linked issue about these - short version is that this mirrors the implementation used in BlogPost, but I can't update BlogPost to take advantage of it just yet. That'll be handled in a separate issue.

Issue

@GuySartorelli
Copy link
Member Author

JS CI failure is unrelated to these changes

DataObject $ownerRecord
): FormField {
$parent = ($ownerRecord instanceof SiteTree) ? $ownerRecord->Parent() : null;
$field = TagField::create(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any reason to use TagField over SearchableMultiDropdownField? From memory their UI is quite similar, though TagField could create (update?) new records from within the field (add a string, press enter, create/update a record), while SearchableMultiDropdownField is for linking existing records which I think is what we're doing here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TagField is what it's already using so I'm just copying that logic across.
But yes, the main difference is the ability to create new tags/categories directly in the formfield itself, which makes it quicker to add them.

I'm not aiming to change the way people add or create tags or categories with this PR.

Copy link
Member

@emteknetnz emteknetnz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally, looks good

@emteknetnz emteknetnz merged commit c736dce into silverstripe:5 Jun 26, 2024
11 of 12 checks passed
@emteknetnz emteknetnz deleted the pulls/5/scaffolded-fields branch June 26, 2024 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants