-
-
Notifications
You must be signed in to change notification settings - Fork 541
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
[4.x] Add ability to customize bard/replicator set icons directory #8931
Conversation
This reverts commit ca573de.
…ript for <svg-icon> component now.
Is it possible to choose the folder in a Blueprint as a field config? I didn't realize this would be an all-in ServiceProvider thing 🤔 |
I actually had that implemented first (you can see it in my commit history here in this PR), but Jason backed me away from that implementation and suggested we should do the service provider thing instead. There was problems with reading from the same bard blueprint config where you set the folder and use the custom icons, before having saved the config first. Would've required extra custom ajax. There was another problem too, but I forget what now. Happy to revisit 🤔 |
Oh it's coming back to me... The other concern Jason had was that people probably wouldn't want separate icon folder configs for every bard or replicator in a large app. If they're pulling from a custom set of icons on one bard field, we figure they'll probably want those extra custom icons on all bards, without having to configure over and over. |
Ah fair enough I totally get that. Good calls then! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like the Bard Set Icons are broken with this PR.
Before, when I picked an icon it would save just the icon name without the subfolder.
sets:
new_set_group:
display: 'New Set Group'
icon: addon-boxes-stack
Now it saves with the subdirectory on the Set level, so all existing icons are broken, and for some reason new ones don't render either, neither the group nor the set itself, even if i configure everything after checking this PR out. I can't figure out what the correct format is and none of them seem to work.
However, if I set dir in the AppServiceProvider, everything seems to work fine. 🤔
Awkward yeah. Apparently I'm bad a coding at midnight on Fridays 🙈 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works great!
Adding notes on how to use: To use, edit the the boot method in public function boot(): void
{
// Statamic::script('app', 'cp');
// Statamic::style('app', 'cp');
\Statamic\Fieldtypes\Sets::setIconsDirectory(folder: 'light');
} That will use the light folder within the icons folder. If you want to set a completely custom path you can do:
Also only .svg icons are supported. |
This PR adds ability for user to customize bard/replicator set icons directory in a service provider.
Usage
Choose a different icon set for bard/replicator set icons...
Choose a different base directory altogether...
Todo