doublesecretagency / craft-starratings

Star Ratings plugin for Craft CMS
Other
4 stars 3 forks source link

Styling the form field icons #10

Open dmatthams opened 4 years ago

dmatthams commented 4 years ago

Hello, I've disabled font awesome as I already have it loaded and have set custom icons on a page like this:

{% do craft.starRatings.setIcons({
    'full'  : '<i class="fas fa-star"></i>',
    'empty' : '<i class="far fa-star"></i>',
}) %}

This successfully changes the icons when pulling the rating from an entry i.e: {{ craft.starRatings.stars(entry.reviewsFeaturedReview[0].id) }} but not for the form field: {{ craft.starRatings.formField('reviewRating') }}. Here, it's still trying to use far fa-star-o for the empty star?

Am I doing something wrong or is this a bug?

Thanks

lindseydiloreto commented 4 years ago

It's definitely a bug, thanks for reporting. 👍

I'll try to take a look into patching it soon... I don't have a specific ETA, sorry.

dmatthams commented 4 years ago

No worries, thanks. Will just re-enabled included font awesome for now.

dmatthams commented 4 years ago

I've hard-coded the field.js file to use far fa-star instead of fa fa-star-o just to make it compatible with latest version of font awesome (fa-star-o no longer exists). Possibly worth doing the same on the next release, updating the font awesome dependency.

dmatthams commented 4 years ago

Also (last thing I promise!) turning font awesome off renders the field type useless.

lindseydiloreto commented 4 years ago

That sounds good. Hacking the JS file was definitely the right solution for now. 👍