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'm working on a project with many content types and many Panels and variants. We'd like the same social sharing configuration throughout, i.e. a global toolbox. I've thrown together something that meets our needs and am sharing the diff from 4.x to get the conversation started about a proper implementation of this feature.
Comment | File | Size | Author |
---|---|---|---|
addthis-7.x-4.x-global-toolbox.patch | 6.64 KB | dubois |
Comments
Comment #1
matglas86 CreditAttribution: matglas86 commentedLooks nice. I would strongly suggest to move this into a field formatter like the others and then use the settings function on in the .module file to create a configurable global setting. Look kinda like the block settings page.
Comment #2
matglas86 CreditAttribution: matglas86 commentedI had problems running this patch against the lastest commit on 7.x-4.x. Can you checkout if it applies and otherwise reroll it against that head?
This was the error.
Comment #3
matglas86 CreditAttribution: matglas86 commentedI have to revise my suggestion because you already added it into a field formatter. :)
Here is the suggestion to look at when it comes to the settings form. You can use this function _addthis_settings_form() in addthis.module. This is the central function that is used in addthis_form_block_admin_configure_alter to generate a settings form based on the field formatters. Its using ajax, just like the settings form for formatters itself on the 'Manage display' page.
And then:
I hope this helps you getting in the right direction for this functionality.