I'm sorry but I need a bit more hand holding here than your usual Umbraco peep.
I just wanted to confirm that it sounds like your saying that we don't need to worry about the Javascript from the Mark S Kolich post above, but instead we can do it on each a href with your XSLT?
You could indeed do it all with just xslt and ignore the javascript such as "self.location.href" as used in the linked post, so in your list of social sites you'd have something like
<xsl:variable name="thisPage"> <xsl:text>http://</xsl:text>; <xsl:value-of select="umbraco.library:RequestServerVariables('SERVER_NAME')"/> <xsl:value-of select="umbraco.library:NiceUrl($currentPage/@id)"/> </xsl:variable> <xsl:variable name="thisPageTitle"> <xsl:value-of select="$currentPage/@nodeName" /> <!-- or whatever other property you want to use for page title --> </xsl:variable>
Looking at the linked post, I don't like (and don't see why he has done this) adding non-standard attributes to the A tag but something like the above should also work and doesn't rely on javascript.
A nice tip is that for Facebook (and I believe others are adopting it) you can include an image url in your head of your doc and Facebook will use that as the default image for your page when you link to it
@Peter - nice one for that, will definitely do that as I can imagine my client loving the fact we can pass their logo over!
@Dan -
Thank you, you've already been a huge help, and really do appreciate your assistance here.
I've done as you've suggested above, but with the example you've given (i.e. Stumble Upon) the XSLT is tripping over having "&title" in the achor href. I know this has come from the AddThis list and yes I would prefer to keep it as passing the page title is a nice touch.
I'm just wondering if maybe the href is too long for XSLT and maybe I need to break it down and build the string through using "xsl:attribute"?
share this - social bookmarking package?
Hello,
I wanted to add the ability to share pages across various bookmarking sites - a bit like the AddThis service but without relying on them.
I found this guy's post which is very helpful but being a bit wet behind the ears I'm struggling to get this working with Umbraco.
http://mark.koli.ch/2009/02/howto-make-your-own-addthis-social-bookmarking-sharing-widget-thing.html
Essentially the problem is with passing the URL of the submitted page.
Can anyone offer any advice? Better still, does anyone have a working solution?
Thanks,
Barney
This will get the full path to the current page in xslt
Then it's just a case of passing this. You could wrap all the above into a variable and then submit that
Then submit it with
Or something like that!
Dan
Hi Dan, thanks for your input on this.
I'm sorry but I need a bit more hand holding here than your usual Umbraco peep.
I just wanted to confirm that it sounds like your saying that we don't need to worry about the Javascript from the Mark S Kolich post above, but instead we can do it on each a href with your XSLT?
Cheers ears,
Barney
Hi Barney
You could indeed do it all with just xslt and ignore the javascript such as "self.location.href" as used in the linked post, so in your list of social sites you'd have something like
Looking at the linked post, I don't like (and don't see why he has done this) adding non-standard attributes to the A tag but something like the above should also work and doesn't rely on javascript.
Hope this helps,
Dan
A nice tip is that for Facebook (and I believe others are adopting it) you can include an image url in your head of your doc and Facebook will use that as the default image for your page when you link to it
<link rel="image_src" href="http://example.com/mypic.jpg" />
You could include that in the master template?
@Peter - nice one for that, will definitely do that as I can imagine my client loving the fact we can pass their logo over!
@Dan -
Thank you, you've already been a huge help, and really do appreciate your assistance here.
I've done as you've suggested above, but with the example you've given (i.e. Stumble Upon) the XSLT is tripping over having "&title" in the achor href. I know this has come from the AddThis list and yes I would prefer to keep it as passing the page title is a nice touch.
I'm just wondering if maybe the href is too long for XSLT and maybe I need to break it down and build the string through using "xsl:attribute"?
What do you think?
Cheers,
Barney
Daft question but is it complaining about undefined entities? The & should be encoded as & is that too obvious?
XSL should not have any problems with the length of the href, it should just get on with it. Try something like:
Bingo. You rock :)
Thanks, late night coding, always a killer ;)
is working on a reply...