<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>blog.johanv.org (Berichten over flattr)</title><link>https://blog.johanv.org/</link><description></description><atom:link href="https://blog.johanv.org/categories/flattr.xml" rel="self" type="application/rss+xml"></atom:link><language>nl</language><copyright>Contents © 2025 &lt;a href="https://blog.johanv.org/pages/contact/"&gt;Johan Vervloet&lt;/a&gt; 
&lt;a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/"&gt;
&lt;img alt="Creative Commons License BY-NC-SA"
style="border-width:0; margin-bottom:12px;"
src="https://i.creativecommons.org/l/by-sa/4.0/88x31.png"&gt;&lt;/a&gt;</copyright><lastBuildDate>Wed, 29 Oct 2025 18:31:22 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>How to add flattr buttons to your Drupal site</title><link>https://blog.johanv.org/posts/old/node-170/</link><dc:creator>Johan Vervloet</dc:creator><description>&lt;div&gt;&lt;p&gt;Here is a quick and diry way for putting dynamic flattr buttons in
articles on a Drupal site.&lt;/p&gt;
&lt;p&gt;The difficult part is getting the
javascript thing in the &amp;lt;head&amp;gt; section of your pages. I did it as
follows:&lt;/p&gt;
&lt;p&gt;I created a file 'flattr.js', with the following
content:&lt;/p&gt;
&lt;pre class="literal-block"&gt;(function() {
    var s = document.createElement('script'), t = document.getElementsByTagName('script')[0];
    s.type = 'text/javascript';
    s.async = true;
    s.src = 'http://api.flattr.com/js/0.6/load.js?mode=auto';
    t.parentNode.insertBefore(s, t);
})();&lt;/pre&gt;
&lt;p&gt;Then
I added the following php code to a block that is visible on every page
of the
site:&lt;/p&gt;
&lt;pre class="literal-block"&gt;&amp;lt;?php
drupal_add_js('sites/johanv.org/flattr.js');
?&amp;gt;&lt;/pre&gt;
&lt;p&gt;(You
might use an existing block, or create a new block just for this
purpose.) Make sure you choose 'php' as input format for the
block.&lt;/p&gt;
&lt;p&gt;Now you just have to paste the code for the button in the
articles, on the place where it is needed. You need to specify full html
as input format though.&lt;/p&gt;
&lt;p&gt;I know there exists a Drupal module for
Flattr, but I think it is not ready for easy usage yet.&lt;/p&gt;&lt;/div&gt;</description><category>drupal</category><category>flattr</category><guid>https://blog.johanv.org/posts/old/node-170/</guid><pubDate>Thu, 21 Apr 2011 21:51:47 GMT</pubDate></item></channel></rss>