I had like to change my own icons.

Could you do the same way as Language icons have a feature:

Icons file path
Text field: sites/all/themes/garland/icons/flags/*.png
Path for language icons, relative to Drupal installation. "*" is a placeholder for language code.

So we can put our own icons or use the default path which is using Follow' icons.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

midmood’s picture

subscribe

BrockBoland’s picture

Version: 7.x-1.0-alpha1 » 7.x-1.x-dev
Status: Active » Needs review
FileSize
38.22 KB
2.63 KB

First swing attached. This adds a "Custom" option to the icon style dropdown, that exposes a CSS file path field when it's chosen. Screenshot attached to demonstrate.

BrockBoland’s picture

FileSize
2.96 KB

Minor tweak from #2: added the new variable to those deleted on uninstall.

q0rban’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Status: Needs review » Postponed (maintainer needs more info)

After reviewing this patch, I found a bunch of stuff I wasn't crazy about in the 1.x branch that this relies on. I've pushed a new branch that diverges from the 6.x branch, implementing some of the d7 APIs. It's a pretty extensive change, but will make this work pretty trivial, I believe, as there are now bona fide icon styles that can declare icon paths. A theme can implement hook_follow_icon_styles_alter to alter an icon path for any of these styles, or declare it's own style. All that is necessary is that the icon paths match up.

I'm going to mark this as 'needs more info' as I'm not sure if this suffices for your use case or not. In theory, if we wanted to make this easier for themers, we could allow a setting in the theme's info to specify the icon path, but I worry this might be overkill. Alternately, we could create an admin page that you could go to to specify the icon path. This would allow us to throw up warnings if there are missing icons, but I'm less crazy about the idea of this as it would mean more variables to save. Anyone can add their own follow.css to their theme and override the icon urls themselves there as well.

I encourage you to check out the 7.x-2.x branch (when it becomes available, currently waiting on d.o to create the file) to see what you think.

BrockBoland’s picture

This is pretty close.

The one complaint I have is that themes cannot define new icon styles. The theme can implement hook_follow_icon_styles(), and you can add a new style to the $styles array…but that new style won't be available when configuring the block, so it can't be chosen. Since the admin theme is the active one when configuring the block, hook_follow_icon_styles() is invoked on the admin theme and not your site theme. You can override one of the existing styles, but not define new ones.

Note that the hook_follow_icon_styles function in follow.api.php should have an _alter on the end of it.

truls1502’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Closed (outdated)

I am going to close this ticket. Please re-open the ticket if you still want this feature.