[6.x] Fix the custom "create entry" button in card view #12598
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This closes #12588 by hooking the handle up to create entry button in the new collection card view.
To try this:
/cp/preferences/edit
'pages_collection_create_entry' => 'Crear XY',
to/resources/lang/es/messages.php
/cp/collections
and see the button above the Pages card now saysCrear XY
Note
Use server-provided
create_label
for the collections grid button and switch label translation keys tostatamic::messages
, including taxonomy term labels.resources/js/components/collections/Listing.vue
:create-entry-button
now usescollection.create_label
instead of hardcoded__('Create Entry')
.src/Http/Controllers/CP/Collections/CollectionsController.php
: Exposescreate_label
in collections payload via$collection->createLabel()
.src/Entries/Collection::createLabel()
andsrc/Taxonomies/Taxonomy::createLabel()
:statamic::messages.{handle}_collection_create_entry
andstatamic::messages.{handle}_taxonomy_create_term
.tests/Feature/Collections/ViewCollectionListingTest.php
: Expectcreate_label
in collections response.Written by Cursor Bugbot for commit c4a7088. This will update automatically on new commits. Configure here.