I know there is a topic already regarding how to add 'adsense' to forums but this is a little different. I was able to add the 'AddThis' code to the templates/base/page_55.html successfully. This puts the 'AddThis' code on every Forum page (for those who don't know), which is actually great....but
When I open a forum topic and click the AddThis button (ex. Facebook), the 'title' of the post is 'Recent Topic :: Forum' instead of the actual forum topic's title. The link that it posts to Facebook DOES take you to that actual forum topic though. Is there a way to get AddThis to grab the title of the forum topic and NOT 'Recent Topic :: Forum'?
Nothing to see here |
One of the reasons i hate orca. All of the pages have the same title if you view the source. Boonex for some reason decided to change the title on the fly using javascript.
I am guessing AddThis is grabbing the page title as it is seen from the source.
I have not tested this, so i do not know if it works. Try adding this under the addthis code. Should be as close to the bottom of the page as possible.
<script type="text/javascript"> var addthis_share = { title: document.title; } </script> https://www.deanbassett.com |
So here is what I have in my Page_55.html. Where exactly do you think it needs to go?
<bx_include_auto:_sub_header.html />
<br>
<My AddThis Code>
__page_main_code__ <bx_include_auto:_sub_footer.html />
Nothing to see here |
After this.
__page_main_code__
Or you can put it before that but after your addthis code. https://www.deanbassett.com |
Hmm.. Tried it above the add this code, below it, and below page_main_code and nothing seem to work.. I wonder if there is another page tied to the forum topic itself instead of Page_55. Nothing to see here |
I was not sure if it was going to work. Found that code on the internet.
The proper way to set the title is as part of the addthis code. But that is server side. And the title is set via javescript which is client side.
Somehow the actual title has to be able to be obtained in script and the addthis code moved in script so it becomes part of what is passed to the template for the _page_main_code__ label.
Problem is i don't know where to do that or how to obtain the title from orca. https://www.deanbassett.com |
Hey Deano,
So if:
title: document.title;
gets the <title> from the page, which when I view page source I can see is 'Recent Topics :: Forum', can the document.title be changed to something else?
For example, when I search for a key word that exists in the actual topic tile, it is called by this: forum_topic_title
So is it possible to change that line to something like this?
title: forum_topic_title;
Nothing to see here |
Thats what i don't know.
Orca i do not work with. I have no clue where in the forum script the title is set.
Best bet is to contact modzzz. I think he has done a lot more work with those forums. https://www.deanbassett.com |
@Zarcon, would you be so kind as to post your AddThis code (or PM if it's top secret). Although my skills are not as great as others, I would really like to try and see if I can help find a solution for this. I may just get lucky, you never know. caredesign.net |
@ProfessorSr, I wouldn't say it's 'top secret' but it is tied to my email & domain for analytics. However I do appreciate your assistance in wanting to help, so you can always do this by signing up at addthis.com yourself (its free). You may even want to eventually use it for yourself sometime.
After signing up, go to Sharing and pick the button styles you want. Click the grab code and insert it into the template/base/Page_55.html as shown below:
<bx_include_auto:_sub_header.html />
<br>
<My AddThis Code>
__page_main_code__ <bx_include_auto:_sub_footer.html />
Trying sharing a forum topic (not the forum page) to FB and you will see what we are talking about.
Nothing to see here |
thanks Zarcon - let's see how lucky I can get caredesign.net |
I wish there was a way to add a php block to the forum page. This is ridiculous. Doing what you said, Zarcon, I see that the link is correct, just what is displayed on Facebook for the link is not correct.
Now, I know nothing about xsl, but was wondering if the AddThis could be placed in one of the Xsl files - specifically the forum_posts.xsl. This is where the original Vote thumbs up is at, so what about replacing that with the AddThis. Then you could specify the url properly.
Just a thought as I have to leave for a few hours.
caredesign.net |
I found this code for changing the AddThis for XSLT, but have not had time to actually try it out, plus it needs to be modified a little bit:
<xsl:text disable-output-escaping="yes"><![CDATA[ <!-- AddThis Button BEGIN --> <div class="addthis_toolbox addthis_default_style" addthis:title="]]></xsl:text> <strong><xsl:value-of select="@nodeName"/></strong> <xsl:text disable-output-escaping="yes"><![CDATA[" addthis:url="http://solidfire.com]]></xsl:text> <strong><xsl:value-of select="umbraco.library:NiceUrl(@id)"/></strong> <xsl:text disable-output-escaping="yes"><![CDATA["> <a href="http://www.addthis.com/bookmark.php?v=#####" class="addthis_button_compact">Share</a> </div> <!-- AddThis Button END --> ]]></xsl:text>
caredesign.net |