Skip to content

Conversation

JayGeorge
Copy link

@JayGeorge JayGeorge commented Sep 26, 2025

This closes #12588 by hooking the handle up to create entry button in the new collection card view.

To try this:

  • Switch the language to Spanish in /cp/preferences/edit
  • Add 'pages_collection_create_entry' => 'Crear XY', to /resources/lang/es/messages.php
  • Visit /cp/collections and see the button above the Pages card now says Crear XY

2025-09-26 at 16 42 19@2x


Note

Use server-provided create_label for the collections grid button and switch label translation keys to statamic::messages, including taxonomy term labels.

  • CP UI (collections grid)
    • resources/js/components/collections/Listing.vue: create-entry-button now uses collection.create_label instead of hardcoded __('Create Entry').
  • Backend
    • src/Http/Controllers/CP/Collections/CollectionsController.php: Exposes create_label in collections payload via $collection->createLabel().
    • src/Entries/Collection::createLabel() and src/Taxonomies/Taxonomy::createLabel():
      • Update translation keys to statamic::messages.{handle}_collection_create_entry and statamic::messages.{handle}_taxonomy_create_term.
  • Tests
    • tests/Feature/Collections/ViewCollectionListingTest.php: Expect create_label in collections response.

Written by Cursor Bugbot for commit c4a7088. This will update automatically on new commits. Configure here.

@JayGeorge JayGeorge linked an issue Sep 26, 2025 that may be closed by this pull request
@jackmcdade jackmcdade merged commit 2c7bed1 into master Sep 29, 2025
21 checks passed
@jackmcdade jackmcdade deleted the custom-create-entry-button-in-card-view branch September 29, 2025 14:09
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.

[6.x] Custom 'Create Entry'-button in card view
2 participants