« October 2010»
M T W T F S S
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31

[blog...]

13.10.2010
16:53

Add Flattr to your T3Blog

Flattr is a possibility to honour content in the web.

 

The users pays a fixed amount of money (e.g. 5 EUR) per month to Flattr and clicks on the Flattr-button on content he likes. At the end of the month, flattr divides the 5 EUR through the amount of clicks and gives this part to the content provider.

I created an account with the username "albig". And I'm able to flattr immediately and submit things, other peoples may flattr.

 

But how to integrate in t3blog?

 

I choose the following way:

  1. Create an extension template and add:
    page.headerData.700 = TEXT
    page.headerData.700.value (
    <script type="text/javascript">
    /* <![CDATA[ */    
    (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&language=de_DE&uid=YOUR_USER_NAME';                
    t.parentNode.insertBefore(s, t);    
    })();
    /* ]]> */
    </script>
    )

    This code is from flattr and integrates the flattr javascript API 0.6 into your website.

    Of course you have to change your flattr userid and your language in the GET-variables. But anyhow. Your userid may be set also in the following code.

  2. Add this to your t3blog template:
    listItem { 
    # Top of a Entry.
    6 = COA
    6 {
     wrap = <div class="socialFlattr">|<div class="clear"><!-- clear --></div></div>
     10 = LOAD_REGISTER
    10 {
     titleBlog {
    field = title
    }
    titleBlog.stripHtml = 1
    }
     20 = TEXT
    20 {
    wrap = <div class="flattr">|</div>
    value (
    <a class="FlattrButton" style="display:none;"
    title="{register:titleBlog}"
     data-flattr-button="compact"
     data-flattr-tags="{register:tagCloud}"
    data-flattr-category="text"
    href="http://linux.bigga.de/{field:blogUrl}">
    {register:titleBlog}
    </a>
    )
    insertData = 1
    }
    }
    }

    single.10 {
    6 < plugin.tx_t3blog_pi2.blogList.listItem.6
    }


    This adds a new content text object to the listItem. The same is copied to the single view at the end of the coding.
  •  
  • 0 Comment(s)
  •  

Your comment

Notify me when someone adds another comment to this post

back

[ 07.05.2012 ]