Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#3 | 1563508-3.patch | 2.96 KB | BrockBoland |
#2 | 1563508-2.patch | 2.63 KB | BrockBoland |
#2 | followcustompath.png | 38.22 KB | BrockBoland |
Comments
Comment #1
midmood CreditAttribution: midmood commentedsubscribe
Comment #2
BrockBoland CreditAttribution: BrockBoland commentedFirst 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.
Comment #3
BrockBoland CreditAttribution: BrockBoland commentedMinor tweak from #2: added the new variable to those deleted on uninstall.
Comment #4
q0rban CreditAttribution: q0rban commentedAfter 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.
Comment #5
BrockBoland CreditAttribution: BrockBoland commentedThis 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.Comment #6
truls1502I am going to close this ticket. Please re-open the ticket if you still want this feature.