What we're listening to:
Jared

The Album Leaf:
Into The Blue Again
Jeff

Paper Route:
Absence

For adding a blog to your refinery site, there’s pretty much only one option: the refinerycms-blog plugin. Fortunately like most refinery things, it’s pretty easy to customize.

I wanted to use DISQUS to moderate the comments on this particular blog, and here’s how I did it (You obviously need a DISQUS account to do this).  If a file referred to doesn’t exist, copy it from vendor/plugins/app/views/blogs to your theme directory.

  1. Remove the old comment form:
    themes/mysite/views/blogs/show.html.erb

    remove the render “_form” line since we don’t need a comment form anymore
  2. Add the Disqus embed code
    themes/mytheme/views/blogs/_comments.html.erb

    Replace everything in this file with the disqus embed code, replace mysite below with your disqus shortname.

    <div id='comments'>
     <div id="disqus_thread"></div>
     <script type="text/javascript">
     var disqus_identifier = "<%= @blog.permalink %>";
     <%= "var disqus_developer = 1;" if local_request? %>
    
     (function() {
     var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
     dsq.src = 'http://mysite.disqus.com/embed.js';
     (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
     })();
     </script>
     <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript=mysite">comments powered by Disqus.</a></noscript>
    </div>
  3. Add the disqus comment counter code
    /themes/mysite/views/blogs/index.html.erb

    Change line 16 to:

      <%= link_to 'Read more', blog_post_url(blog.permalink)+"#disqus_thread" -%>
    

    Put this somewhere near the bottom:

    <% content_for :footer do -%>
     <script type="text/javascript">
     //<![CDATA[
     (function() {
     var links = document.getElementsByTagName('a');
     var query = '?';
     for(var i = 0; i < links.length; i++) {
     if(links[i].href.indexOf('#disqus_thread') >= 0) {
     query += 'url' + i + '=' + encodeURIComponent(links[i].href) + '&';
     }
     }
     document.write('<script charset="utf-8" type="text/javascript" src="http://disqus.com/forums/poetrybooths/get_num_replies.js' + query + '"></' + 'script>');
     })();
     //]]>
     </script>
    <% end -%>

    /themes/mysite/views/shared/_footer.html.erb
    add <%= yield :footer %> to your footer file so our comment counter javascript gets placed there.

Pretty easy.

  • http://iphoneawareness.com/firmware/ Iphone firmware

    such a great article, discuss certanly makes things easier on blogs, more people seem willing to use it.

  • http://malaga.senorstag.com/indexmal/3000/malaga_stag_weekends.htm weekend in malaga

    My own opinion he has just proved himself against the pressure of the u17s and has hit the net ,he also has more of a gift than heskey and rooney is not on song right now..

  • http://www.printmyemotions.com variable data printing

    really Disqus is a great commenting system! I also use it on my blog… But it have one drawback… we can't make comments made in Disqus do-follow and we also can't use commentLuv plugin with it!!

  • http://www.suitusa.com/ man suit

    i think you can't change it to do follow if you put disqus in wordpress because its just like attaching the disqus to a no-follow site. since its installed in wordpress that are no-follow the wordpress program will make it no-follow even if it is a do-follow.

  • http://www.laptopbatteriesinc.com.au/laptop-battery/hp/hp-pavilion-dv8000-battery batteries

    Disqus is really successful, it is save my time, in the last time I want to say something online but can't do that usually, now I can pour my words to everyone

  • http://www.suitusa.com/tools.aspx?id=106 Man Suits

    thanks for posting this. it really help me.

  • http://www.quickdial.in quick Dial

    I also use it on my blog… But it have one drawback… we can't make comments made in Disqus do-follow and we also can't use commentLuv plugin with it!!

  • Eseudora998

    With the development of the people’s life in terms of not only the physical wealth but also the mental refinement,

  • http://beatsforsale.ning.com beats for sale

    i love this system

  • http://www.antiquesrepublic.com/ Antique shop

    ciao!, nice page, great content, keep it up^_^, thanks for that information, want to share something. Do you know that 30% of cigarette smoke that we inhale goes to our brain, and it give the feeling of stimulation, called Addiction^_^, click my name Antique shop for more information.

  • Anonymous

    I have been using Disqus since for a quite while now. I am also moderating my comments on mobile using disqus on mobile. It has really helped me manage my comments well.

  • http://www.mutuellesmutuelle.com/mutuelle-fonctionnaire.php mutuelle fonctionnaire

    Disqus is very useful.

  • http://artoha.ru artoha

    che… Fine :[

  • http://www.yourcosplay.com Cosplay Costumes

    it’s a controversial topic and I think we don’t have right to demean someone or speak for others. There’s no harm in being a home maker for a woman and likewise it’s perfectly if she wants to have a career. Its an individual choice.

  • http://www.laptopbatteriesinc.com/dell/dell-latitude-d820-battery DELL Latitude D820 Battery

    I like this piece of science and technology hardware, but expertise is limited, many do not understand. your post a good, simple and easy article, thank you

  • http://www.laptops-battery.org.uk/Compaq/Compaq-Presario-v4000-Battery Fifi

    I can’t agree more

  • http://www.laptops-battery.org.uk/Compaq/Compaq-Presario-v5000-Battery Woody

    Nice post,Thank you

  • http://www.laptops-battery.org.uk/Compaq/Compaq-Presario-v6000-Battery Mark

    I should share this with my friends

  • http://www.laptops-battery.org.uk/Compaq/Compaq-Tablet-PC-TC1000-Battery Lucy

    Disqus is really wonderful system,I like it very much

  • http://pulse.yahoo.com/_YZQVUSTHCB3KWLHJCGI2KV2V4I Angelina Jolliey

    It is good information regarding comment. It is embed code and counter code and also old comment.

    hp coupons code

  • Anonymous

    There are Programming language embed code, Counter code. It is good information as a step by step.

  • http://praxis2.org/ Praxis 2, Praxis 2 test scores

    Yes! I just saw applications which are using it, they are lot many covering, many CMS as well as some powerful frameworks like Rails, Django, Cakephp, etc. blog comments powered byDisqus .

  • Anonymous

    There are Programming language embed code. It is good information as a step by step,it is really great……

  • Anonymous

    Disqus has many code and this code is very useful for us,it is good information so i request to others please read this post atleast once.

  • Anonymous

    Disqus is great!!!there are many programming language and disqus has many code to solve the programming language problems so i like much more disqus.

  • http://google.com Shalabon23

    Great article, thanks!

  • http://google.com Shalabon23

    refer coomm pingpongback