Closed sebastienros closed 5 years ago
We did something like this in O1. Below is an example. Is this what you are thinking?
Edit: It looks like I posted around the same time as Antoine. That project looks much better, we never spent much time on the look of it.
@douwinga this is exactly what I am thinking about, and the link @agriffard provided is the perfect solution IMO.
I created an Editor for the Text field and I'm currently trying to create a custom field out of it. But for now this works pretty well
Looks great! I don't think a custom field is necessary. I know it might not be optimal right now to find it, but we might change how we display the types of fields by exposing the editors directly at some point. The only reason to have a custom field would be to create one called Css Class, but I don't think it makes much sense.
When do you create the PR for the editor?
@sebastienros I've some troubles in the case when you use multiple versions of the Icon Picker. For example:
Any idea?
<script asp-name="bootstrap" at="Foot" depends-on="admin"></script>
<script name="fontpickerScript" depends-on="admin" asp-src="/OrchardCore.ContentFields/Scripts/fontawesome-iconpicker.min.js" debug-src="/OrchardCore.ContentFields/Scripts/fontawesome-iconpicker.js" at="Foot"></script>
<style name="fontpickerStyle" at="Head" asp-src="/OrchardCore.ContentFields/Styles/fontawesome-iconpicker-min.css" debug-src="/OrchardCore.ContentFields/Styles/fontawesome-iconpicker.css"></style>
OK, I see that the ResourceManager takes care of this. So, I only have to make my inline javascript a little more intelligent to deal with multiple instances of the picker.
Replace a text input with the actual icon, and a selector to display them to chose from a visual list.
Could then be used as an editor for text fields.