Skip to content
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

Added Line Awesome icon font to on icon picker field #3342

Closed
wants to merge 3 commits into from

Conversation

promatik
Copy link
Contributor

As @mpixelz stated on #3339, since backpack adopted line awesome font on v4, it should be available to be used on icon picker field.

image

@mpixelz
Copy link

mpixelz commented Nov 20, 2020

I just checked this.. even thought it does show the lineawesome icons on the editor but the stored values are still fa and fas not la...

@pxpm
Copy link
Contributor

pxpm commented Nov 20, 2020

Indeed, they would never be stored as la icons because iconpicker (the jquery plugin) does not support it.

Even if you set iconset to something weird, it will default to fontawesome.

image

image

Supported by theirs website documentation:

glyphicon|ionicon|fontawesome4|fontawesome5|weathericon|mapicon|octicon|typicon|elusiveicon|flagicon

…fa` before showing the icon on icon picker
@promatik
Copy link
Contributor Author

@pxpm I did some changes, so I replace fa > la before save, and la > fa before showing the icon on icon picker.
It's now stored as lineawesome.

This is possible because line awesome provides a font with the same naming as font awesome (fa).
It's working, is it a desired feature to make up for the extra layer of logic?

@tabacitu
Copy link
Member

tabacitu commented Nov 20, 2020

Ugh now that's just sad 😞😅

Now that I hear about it, it does make perfect sense to have line awesome inside the icon picker - especially if you use the backpack interface for both users and admins...

Any way we can make it a "supported font"?

  • a) Doesn't iconpicker provide a way to extend it?
  • b) If not, how difficult would it be to create a PR to their project for it? And how likely is it that it's get accepted? Better ask first. It's an opportunity to thanks someone whose work we've been using for a while now.

@promatik
Copy link
Contributor Author

@tabacitu it appears we commented at the same time 😅 just check my previous comment if you missed out.

Yesterday I though about pushing a PR to add this font, but the project seems a little idle, the latest commit was 2 years ago and there are some issues and PR open.

@scrutinizer-notifier
Copy link

The inspection completed: No new issues

Comment on lines +40 to +42
if($field['iconset'] === 'lineawesome') {
$value = preg_replace("/^la(.) la/", 'fa$1 fa', $value);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm i'm pretty sure this work, yes. But... if feels a bit like hardcoding it, doesn't it?

It makes me wonder - what happens with the other fonts? Metronic definitely doesn't use the "fa fa-x" syntax so... I'm weary of merging a solution that will make this field work one way for line-awesome and a different way for all other fields.

I think it'll make it more difficult to maintain down the line. And more difficult to read and understand.

So yes it's a solution 😀 But I don't think it's the solution we're looking for 😅

What if we fix this upstream? Any way we can do that? Please see my latest comment in the thread, just posted.

@tabacitu
Copy link
Member

Yesterday I though about pushing a PR to add this font, but the project seems a little idle, the latest commit was 2 years ago and there are some issues and PR open.

Hmm that's right. I see you've already contributed the project a few years ago 😀 🎉

Let's do this:

I'm really hoping we can have a "proper" fix for this, not a hack 🤞

@promatik
Copy link
Contributor Author

@tabacitu I agree it's a messy code and we should avoid it. It was kinda a smart move to try to use the flavor of line awesome with the prefix of font awesome, but I forgot the part of saving it 😅
Let's wait for an answer from Victor.

@promatik
Copy link
Contributor Author

Since @pxpm got a better solution for this problem, let's close this PR and move the conversation to: #3345

@promatik promatik closed this Nov 21, 2020
@promatik promatik deleted the lineawesome-on-iconpicker branch November 21, 2020 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants