#Change Create new Domain Text to Sample Button

39 messages · Page 1 of 1 (latest)

fallow cosmosBOT
#

How to change the text Create new Domain to Sample button guys

brave ploverBOT
#

Original message from @merry coral - Moved from #general message

limber umbra
#

Good morning

#

Hmmm, the button when there are no items in a collection?

#

@merry coral

merry coral
#

That's right, there are no items in the collection

limber umbra
#

So you want it to say "Create Sample" instead

merry coral
#

I just want to change the word Create new Domains to another text like example button

limber umbra
#

@short heart There's no built-in config for this to replace with a custom component right?

short heart
#

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

limber umbra
#

@merry coral this is a bit hacky but, for now

#

in your payload admin config, specify a CSS file to use custom style

merry coral
#

How do you do it?

limber umbra
#
  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

short heart
#

so you dont lose accessibility of the button

limber umbra
#

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

merry coral
#

I got it, let me try it with my project

limber umbra
#

Good luck! let us know if you get stuck

merry coral
#

It worked

merry coral
#

Hey guys, I have a question: how to pass the token value to a reactjs component

limber umbra
#

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

merry coral
#

Of course, I don't mind that