Posted by Sheepdog on 20 Apr 2010 09:29, last edited by GoVegan on 09 May 2010 05:49
Tags: bitly code link social stumbleupon twitter
Wheel already invented
I wanted to put a "recommend to Stumbleupon" link on one of my wikidot pages. (I am a user of a free account). I spent more time than I want to admit looking for how to do this before I noticed that all of my pages ALREADY HAVE a button to cast a Stumbleupon vote! That is provided courtesy of the standard, wikidot provided, bar at the top of my page.
I'm writing this just in hopes that the next person who searches for "how to link to Stumbleupon" or "how to insert Stumbleupon html" will find this. I did TRY to rtfm, but when clever designers try to make things (wikidot) idiot proof, they sometimes don't quite provide for how clever the idiots (me) can be!
Another solution
Sometimes, the wheel has to be reinvented … when the [[social …]]…
… is not updated with new social services or when the top bar does not show what the webmaster wants.
For example, Bit.Ly, LinkedIn or Viadeo are missing. And the Twitter button does not squeeze the URL like Bit.ly can do.
Includes
Create the following includes and add your own icons …
include:post-stumbleupon
[[div class="mysocialbuttons"]] [[image http://gerdamicsi.wikidot.com/local--files/include:post-stumbleupon/stumbleupon.png link="http://www.stumbleupon.com/submit?url=%%link%%"]] [[/div]]
include:post-twitter
[[div class="mysocialbuttons"]] [[image http://gerdamicsi.wikidot.com/local--files/include:post-twitter/twitter.png link="http://twitter.com/home?status=%%title%%+%%link%%"]] [[/div]]
include:post-bitly
[[div class="mysocialbuttons"]] [[image http://gerdamicsi.wikidot.com/local--files/include:post-bitly/bitly.png link="http://bit.ly/?v=3&u=%%link%%&s=%%title%%"]] [[/div]]
On a live _template
[[module CSS]] .mysocialbuttons {display:inline;} [[/module]] [[include :gerdamicsi:include:post-bitly]] [[include :gerdamicsi:include:post-blogger]] [[include :gerdamicsi:include:post-bx]] [[include :gerdamicsi:include:post-delicious]] [[include :gerdamicsi:include:post-digg]] [[include :gerdamicsi:include:post-facebook]] [[include :gerdamicsi:include:post-gmail]] [[include :gerdamicsi:include:post-google]] [[include :gerdamicsi:include:post-google-buzz]] [[include :gerdamicsi:include:post-linkedin]] [[include :gerdamicsi:include:post-live]] [[include :gerdamicsi:include:post-mixx]] [[include :gerdamicsi:include:post-myspace]] [[include :gerdamicsi:include:post-netvibes]] [[include :gerdamicsi:include:post-print]] [[include :gerdamicsi:include:post-reddit]] [[include :gerdamicsi:include:post-scoopeo]] [[include :gerdamicsi:include:post-slashdot]] [[include :gerdamicsi:include:post-stumbleupon]] [[include :gerdamicsi:include:post-technorati]] [[include :gerdamicsi:include:post-twitter]] [[include :gerdamicsi:include:post-typepad]] [[include :gerdamicsi:include:post-viadeo]] [[include :gerdamicsi:include:post-wikio]] [[include :gerdamicsi:include:post-yahoo-bookmarks]]
Note: the display:inline CSS instruction allows to align the icons horizontally.
Of course, change "gerdamcsi" by your sitename and remove the front spaces if you copy and paste the code above.
In action
Check this page from the test: category !
Related
Author
gerdami. Please visit his/her userPage.
On this http://community.wikidot.com/howto:stumbleupon I had to insert a space into {$link} within a code block to prevent the parser from replacing {$link} by the current URL.
Does anyone know a better solution ?
gerdami - Visit Handbook en Français - Rate this howto:import-simple-excel-tables-into-wikidot up!
Same thing was happening here and I thought I fixed it by placing the text inside a code block, but now it is broken again. I don't have time at the moment to test, but maybe a div block styled like a code block is a workaround. Then we can make the text unparsed with ....
-Ed
Community Admin
This is really annoying! I've tried multiple methods to escape the {$link} and {$title} variables, but they always get converted. It has to be due to that fact that a live template is attached to the howto category. When I paste the page source into a page that is not processed by a live template this is not an issue.
-Ed
Community Admin
There is a live template attached but no reference to {$link} or {$title}. Moreover, {$variables} are not related to _templates but to includes. But there is no include in the live _template.
Bizarre, bizarre.
gerdami - Visit Handbook en Français - Rate this howto:import-simple-excel-tables-into-wikidot up!
Hi guys, let me help clear up some issues for you.
Firstly, you can escape a variable like so: @@{$@@variable}
Secondly, all of this has to do with ErichSteinboeck. He created a System Variables HowTo, which involves the live template including it's own page and setting the {$} variables of the included page (itself) with %% variables. He placed this code on the howto:_template page to demonstrate it in his howto.
I have found the technique to interfere on a few occasions (as you guys are experiencing right now). As a solution, I will remove it from the howto category, and move it to it's own category.
Thanks James, that makes sense. I swear I tried something like your suggestion, but must not have. One thing to note is that your trick for escaping the variable doesn't work in a [[code]] ... [[/code]] block. You have to use [[div class="code"]] ... [[/div]] to get it to display in a way that the user can copy/paste the code without editing.
-Ed
Normal code block
div with class="code"
{$variable}
Community Admin
Yeah, you're right :D
Okay, I've transferred Erich's things to his own category (erichsteinboeck) which no longer interferes with the howto category.
Thanks James.
I prefixed each line of the code blocks with a space to prevent the code to be parsed.
Is there another way to achieve this ?
gerdami - Visit Handbook en Français - Rate this howto:import-simple-excel-tables-into-wikidot up!