Hi,

The span tag generator by default hardcodes an empty value,

$meta_generator = array(
        '#type' => 'html_tag',
        '#tag' => 'span',
        '#attributes' => $attributes,
        // It's an empty span tag.
        '#value' => '',
      );

I had a requirement where we wanted to show the service title like Facebook, Twitter inside the span tag instead of the default empty span tag.

Comments

swarad07 created an issue. See original summary.

swarad07’s picture

Status: Active » Needs review
StatusFileSize
new3.08 KB

Attaching a patch for the above, added a config Display service name inside span which when enabled will show the service name inside the span tag.

swarad07’s picture

Status: Needs review » Needs work

The patch had typo.

swarad07’s picture

Status: Needs work » Needs review
StatusFileSize
new3.08 KB
swarad07’s picture

Status: Needs review » Needs work
swarad07’s picture

Status: Needs work » Needs review
StatusFileSize
new3.52 KB

Adding missing StringTranslationTrait

bibliophileaxe’s picture

Status: Needs review » Needs work
bibliophileaxe’s picture

Status: Needs work » Needs review

If we need a hook to alter other values as well apart from text rendered in the span, use this one - https://www.drupal.org/project/sharethis/issues/2900290

Just for span text, this look ok.

greg boggs’s picture

StatusFileSize
new3.53 KB

Looks like the patch is a bit out of date, so I Updated the patch and tested it

greg boggs’s picture

Status: Needs review » Reviewed & tested by the community
naveenvalecha’s picture

Assigned: swarad07 » Unassigned
Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs tests
+++ b/config/install/sharethis.settings.yml
@@ -11,6 +11,7 @@ option_extras:
+option_show_title: 0

We need an update path to add this property to the sharethis.settings configuration object.
Also, a post_update test to verify the update function.