Extension, Plugin


EE ShareThis

ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From Protean Web


strip_html and removing share this icon

Support Request



I have a question regarding the ‘strip_html’ button parameter. I can’t seem to get it working. I have tried strip_html, strip_html=“true” and strip_html=“yes”, but html is still being sent to my description parameter. Any thoughts?

Also, is there a way to remove the share this logo? I’d like to use my own graphic.

Thanks for the helpful plugin :)

# 1


strip_html=“yes” is the correct way to enable the feature, and its actually the default setting for the plugin. Basically all this setting does is call php’s strip_tags function on the parameter values. On my dev server running the latest version of ee_sharethis, the strip_html parameter seems to be working. Would it be possible for you to post the ee_sharethis template tag you are using, as well as the corresponding <span> tag that is produced? That should help me get down to the bottom of this.

As for custom buttons, you can set the button display type to “custom” by using display=“custom” in the button tag or setting the default display type to “custom” within the extension settings page. Then you need to add a css line to your stylesheet to set the appropriate image. It will look like this:

      background: url(“http://path/to/image/file”) no-repeat scroll left top transparent;
      padding:0px 16px 0 0;

ShareThis has some rules about what is an acceptable custom image, as well as some more instructions for custom styling that can be found here: http://help.sharethis.com/customization/custom-buttons

# 2

Thanks for the quick reply :)

Here is my button tag and parameters. I’m using MX jumper to populate the parameters:

<li id="share-this">{exp:sharethis:button url='/{exp:mx_jumper:out name="mega_url"}' title='{exp:mx_jumper:out name="mega_title"}' image='{exp:mx_jumper:out name="mega_image"}' description='{exp:mx_jumper:out name="mega_description"}' strip_html="yes" display="custom"}</li>
{exp:sharethis:js load_late="yes" share_button_color="#f7941d"


Here is the resulting span tag:

<span class=“st_sharethis_custom” st_title=“Test 3” st_url=“http://...” st_image=“http://...” st_summary=’<p>
’ displayText=“Share”></span>

I still cannot get the custom icon to work. When I add display=“custom” as a button parameter nothing gets displayed, even with my css rules in place.

# 3

Hi Anthony,

To solve the summary html problem, I have an idea. Instead of passing the summary as a parameter, EE ShareThis allows you to pass it between a tag pair like this:

{exp:sharethis:button url=”“}Description goes here{/exp:sharethis:button}

What I think was happening before, is the mx_jumper content was being parsed AFTER the sharethis button was produced, which would explain why the html doesn’t get stripped. Placing the mx_jumper tag within a sharethis tag pair should force mx_jumper to be parsed first. Hopefully using the tag pair fixes your problem.

About the custom button, the span tag you posted looks correct. I’m not sure how to help debug with that. It must be that the image path is incorrect, or perhaps the css you are using is being overridden by something else?? Also, keep in mind that the displayText attribute is ignored when using a custom button. It might be worth poking around the ShareThis forum for more information if you still can’t get the custom button to work: http://forums.sharethis.com/

# 4

I am also unable to get strip_html to work, this is my tag:



# 5

Hi Billy, if your having the same problem then maybe there is something else going on. Still, could you give the tag pair suggestion a try that I mentioned above and see if that works for you? Technically the snippet you posted should work, and indeed I pasted your snippet on to my dev server, replacing the tags with actual text, and the stripping was performed as expected. Does replacing “{fr_description}” with actual html content work as expected? Thanks guys for working with me on this one. I definitely want to get it resolved ASAP.


# 6

Doing it the tag pair way worked. So there is a problem with the single button tag.
However, when i do the same with plus one and fblike tag, it doesn’t work.
So for both fblike and plusone, strip tags fails to work for both single tags and tag pairs.

# 7

Thanks for the clarification Billy. Did you try placing the html content within the single tag directly? If that works, the issue is likely related to parsing order. Otherwise, it is something more elusive that I’ll need to continue investigating.

Keep in mind that the fblike buttons (not sure about the plusone) pretty much ignore the parameters for summary, image, url, etc. Instead, they rely on the Open Graph tags for that page, or if not present, crawl the page to determine the parameters manually. While not desirable, this is not something that I can control. The ShareThis representatives claim it is a short coming of the Facebook Like Button API.