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.
Currently, the theme_sharethis function in sharethis.module defines the span attributes without allowing them to be extended or overridden in a custom implementation. I would like to present a solution which allows a developer to override the span attributes in a custom theme_sharethis implementation.
Comment | File | Size | Author |
---|---|---|---|
#9 | sharethis-span-attributes-accessible-in-theme-function-2547601-9.patch | 632 bytes | navneet0693 |
| |||
#7 | Screen Shot 2016-05-16 at 7.54.52 PM.png | 138.81 KB | navneet0693 |
#2 | sharethis-span-attributes-accessible-in-theme-function-2547601-2.patch | 925 bytes | jpcondon |
Comments
Comment #2
jpcondon CreditAttribution: jpcondon at Mindgrub Technologies for Dixon Valve commentedHere is a patch that modifies the attributes array within theme_sharethis in the sharethis.module to put it within the variables array. This creates the ability for modules to add their own implementations of theme_sharethis and pass the attributes array to the function with any overrides they may need based on their use case. Some examples include adding st_summary and st_image attributes or overriding the default st_title and st_url implementations.
Comment #3
Nitesh Sethia CreditAttribution: Nitesh Sethia as a volunteer and at QED42 commentedThis patch works as expected. So changing the status of it to Reviewed and Tested by community so that we can port this patch in the next release of Sharethis module.
Comment #4
purushotam.rai CreditAttribution: purushotam.rai at QED42 commentedComment #6
purushotam.rai CreditAttribution: purushotam.rai at QED42 commentedComment #7
navneet0693 CreditAttribution: navneet0693 as a volunteer and at QED42 commentedThrows certain errors.
Comment #8
navneet0693 CreditAttribution: navneet0693 as a volunteer and at QED42 commentedThis will lead to undefined index error. Also, I didn't understood the it must be:
$variables['attributes'] = $attributes
Comment #9
navneet0693 CreditAttribution: navneet0693 as a volunteer and at QED42 commentedComment #10
navneet0693 CreditAttribution: navneet0693 as a volunteer and at QED42 commentedComment #12
navneet0693 CreditAttribution: navneet0693 as a volunteer and at QED42 commentedComment #13
yogeshmpawarPatch is working fine & errors are gone.
Comment #14
yogeshmpawarComment #15
naveenvalechapatches always automated tested against the branches.
Comment #17
purushotam.rai CreditAttribution: purushotam.rai at QED42 commented