#Change Create new Domain Text to Sample Button
39 messages · Page 1 of 1 (latest)
Original message from @merry coral - Moved from #general message
Help is on the way! To mark it as solved, use the /solve command. In the meantime, here are some existing threads that may help you:
Documentation:
- Drafts - Reverting to published
- Relationship Field - Admin config
- Stripe Plugin - Sync
- Lexical Rich Text - Converters - Lexical => HTML
- Redirects Plugin
Community-Help:
Good morning
Hmmm, the button when there are no items in a collection?
@merry coral
That's right, there are no items in the collection
So you want it to say "Create Sample" instead
I just want to change the word Create new Domains to another text like example button
@short heart There's no built-in config for this to replace with a custom component right?
I dont think so for that button tbh unless you override the whole list view component
That button rarely shows because its hidden immediately once you have content
@merry coral this is a bit hacky but, for now
in your payload admin config, specify a CSS file to use custom style
How do you do it?
admin: {
css: path.resolve(__dirname, 'test.css'),
},
Then, youll want to target your specific collection
one sec
.collection-list__no-results > a.btn > span {
display: none;
}
.collection-list__no-results > a.btn:after {
content: 'HELLO WORLD';
}
However, with this being a global style, it will affect all collections. You need to refine the specificity of the css rule to only apply to your collection
This would require an identifying class somewhere on the collection page
I didn't see one on a quick look, but it may be something that could be added so that you can target this collection in particular
It's not a perfect solution, but it's a step closer
Do you understand what I'm saying?
But again, kind of a crummy solution atm xD
instead of display none i would make it just visually-hidden btw https://gist.github.com/luxplanjay/6f6936b1bba7afe006fa9317b07b6045
so you dont lose accessibility of the button
Ah very good point
As for the issue of targeting a collection. I would look into the available custom components that can be swapped out in the documentation
You could in theory, replace a component that wraps that section with an identical structure, but append an identifying classname on one of the wrappers
I got it, let me try it with my project
Good luck! let us know if you get stuck
It worked
Hey guys, I have a question: how to pass the token value to a reactjs component
Heya @merry coral - do you mind creating a new thread for your second question?
Since the first one was solved, it helps keep these more accesible
Happy to help
Of course, I don't mind that