addthis button

Has anyone implemented an addthis share button into each result on a list page? I tried doing it as an html xy expression with the escape set to no and got "Unexpected '<' in expression"

<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style ">
<a href=";username=dealsketcher" class="addthis_button_compact">Share</a>
<span class="addthis_separator">|</span>
<a class="addthis_button_preferred_1"></a>
<a class="addthis_button_preferred_2"></a>
<a class="addthis_button_preferred_3"></a>
<a class="addthis_button_preferred_4"></a>
<script type="text/javascript" src=""></script>
<!-- AddThis Button END -->
Hey there

You seem to have forgotten the double quotes in the expression.
Also, you have tou double double quote the double quotes inside the expression! It looks confusing, but I can't describe it better... :P
You have to insert the expression like this:

"<!-- AddThis Button BEGIN -->
<div class=""addthis_toolbox addthis_default_style"">
<a href="";username=dealsketcher"" class=""addthis_button_compact"">Share</a>
<span class=""addthis_separator"">|</span>
<a class=""addthis_button_preferred_1""></a>
<a class=""addthis_button_preferred_2""></a>
<a class=""addthis_button_preferred_3""></a>
<a class=""addthis_button_preferred_4""></a>
<script type=""text/javascript"" src=""""></script>
<!-- AddThis Button END -->"
...I guess that what Pedro tried to explain is that the escaping of strings is the same as VB. You need to use double-quotes to escape double-quotes, in a string.  :)


Paulo Tavares
Thanks! That worked perfectly. I'm slowly but surely making progress in my application :).

If I want to customize that a little bit more and add parameters from my application into the html, is that possible? For example, with addthis, you can add into their coding:

addthis:title ANY TITLE HERE
addthis:description ANY DESCRIPTION HERE

and the addthis share button will pick that up and share your title and description with your page. For example, if I wanted FIELD 1 of my result to be the title, is there a way to pick up the parameter in the html? Does this make sense? Otherwise when I share each item in the list, it just shares the main page title, no the individual record title.

Hi Mark,

I would assume that you could do it, yes. What's the exact syntax for the addthis button, for the title and parameter?

The way to do it is quite easy, actually. It's, once again, a matter of manipulating strings.

According to their example page, the syntax is:
<a href="" 
      addthis:title="An Example Title"
      addthis:description="An Example Description"></a>

so, as I see it, the way you should do it is, in the <a href... > line in your code, use

<a href="";username=dealsketcher""

             addthis:url=""" + yourURLvariable + """
             addthis:title=""" + yourTITLEvariable + """            
             addthis:description=""" + yourDESCRIPTIONvariable + """>Share</a>

where yourURLvariable, yourTITLEvariable and yourDESCRIPTIONvariable are variables in your action flow or web screen. yourTITLEvariable will be FIELD 1, as you said. Regarding the URL, probably you don't need to pass it - especially since that'll be a bit tricky for you to know in runtime. It's not something that can't be done, but I wouldn't go there yet while you're still getting the grip of the language :)

Do note the THREE double-quotes - two to escape the " character, and one to close the string, in order to concatenate it with a variable in your code.

I hope this helps!


Paulo Tavares

EDIT: Actually, only now did I see that you indeed really want to pass the URL. My best suggestion is that you have an entry point for the screen you want to, and that the screen has an input parameter, depending on the list item you're trying to view. Then in the URL pass, explicitely,

http://yourservername/youreSpacename/yourEntryPointName.aspx&ParameterName=""" + theRightIdForTheItem :)

You can read the right Id for the item the same way you are reading it already for the regular link.

I hope this helps.
I am having trouble getting it to actually grab the information from my table. Instead, it inserts the code I am using to pull the title and description as text. I'm not sure that I am using the right code to pull information either? When you say your title variable, do I actually need to create variables to hold this information or do you just mean that the information is a variable because it varies from row to row?

Would I use some kind of "get" code to pull the parameters? And I somehow need to get out of my line of code for a second to pull the variables and then put them back into the code as variables. Make sense?

Disregard, got it to work. I was working on something else and it clicked. I then applied this to the information you gave me above and now it is working.

+ DealTable.List.Current.DEAL.request +

Thanks Again,
Hi Mark,

I'm glad you got it to work.

One good way to better understand how the language works as a whole is to take our online training in the Academy section on the topics you're having the most trouble with.

I hope this helps!


Paulo Tavares
Hey guys,

I've attempted to add the addthis button to one of my pages xy expresssion. Everything seems to work fine but css seems to be disrupted. The richwidget popup isnt working. Instead of the popup, espace opens a new window. How do I correct this? The addthis code is as follows:

<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style ">
<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
<a class="addthis_button_tweet"></a>
<a class="addthis_button_google_plusone" g:plusone:size="medium"></a>
<a class="addthis_counter addthis_pill_style"></a>
<script type="text/javascript" src=""></script>
<!-- AddThis Button END -->