Showing posts with label Blogger. Show all posts
Showing posts with label Blogger. Show all posts

Recent Comments Section on Blogger

Mar 4, 2014
Adding a Recent Comments widget on your blog will help let your visitors know that your blog is active - especially if you've got new comments coming from readers.

There are many widgets out there that you may use.
The following steps below would add a Recent Comments section on your sidebar without having to use third-party functionalities.

  1. On your dashboard, go to Layout.
  2. Click on Add a Gadget on where you would want to place your Recent Comments section.
  3. Choose Feed.
  4. Add your comment feed URL Format: http://blogname.blogspot.com/feeds/comments/default
  5. Click Continue.
  6. Make final changes and click Save.
Another is to use scripts generated by third-party functionalities.
Below are the links of these scripts and the instructions on how to use them:
If you've got more tips, please don't hesitate to drop your message on the comments section. Thanks!

UPDATE: Blogger now offers the RECENT COMMENTS widget, so YAY!!
Read more ...

How to Add Syntax Highlighter in Blogger

Feb 27, 2014
Follow these very simple steps on how to add syntax highlighter for your Blogger blog.

  1. Go to Dashboard > Template.
  2. Click on Edit HTML.
  3. Copy the following code before the </head> tag.
    <!-- Syntax Highlighter Additions START -->
    <link href="http://alexgorbatchev.com/pub/sh/current/styles/shCore.css" rel="stylesheet" type="text/css" />
    <link href="http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css" rel="stylesheet" type="text/css" />
    <script src="http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js" type="text/javascript" />
     
    <script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushAS3.js" type="text/javascript" />
    <script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushBash.js" type="text/javascript" />
    <script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushColdFusion.js" type="text/javascript" />
    <script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCSharp.js" type="text/javascript" />
    <script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCpp.js" type="text/javascript" />
    <script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCss.js" type="text/javascript" />
    <script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushDelphi.js" type="text/javascript" />
    <script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushDiff.js" type="text/javascript" />
    <script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushErlang.js" type="text/javascript" />
    <script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushGroovy.js" type="text/javascript" />
    <script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js" type="text/javascript" />
    <script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js" type="text/javascript" />
    <script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJavaFX.js" type="text/javascript" />
    <script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPerl.js" type="text/javascript" />
    <script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPhp.js" type="text/javascript" />
    <script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPlain.js" type="text/javascript" />
    <script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPowerShell.js" type="text/javascript" />
    <script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPython.js" type="text/javascript" />
    <script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushRuby.js" type="text/javascript" />
    <script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushScala.js" type="text/javascript" />
    <script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushSql.js" type="text/javascript" />
    <script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushVb.js" type="text/javascript" />
    <script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js" type="text/javascript" />
      
    <script language="javascript" type="text/javascript">
     SyntaxHighlighter.config.bloggerMode = true;
     SyntaxHighlighter.all();
    </script>
    <!-- Syntax Highlighter Additions END -->
    
    • You may change the theme on this line. Click here for the list of themes.
      <link href="http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css" rel="stylesheet" type="text/css" />
      
    • You may prefer to include only the brushes that you will be using to save load time.
  4. Save template.
  5. On creating a new post, when a code snippet is to be added, go to HTML mode.
  6. Place your code snippet in between the following tags:
    <pre class="brush:csharp;">
    // code here
    </pre>
    
  7. Click Publish.

Reference(s):

Read more ...

Sample Post with Syntax Highlighter

Feb 27, 2014
This is just a sample post using syntax highlighter.
Will discuss how to install the highlighter in a different post.

/// <summary>
/// Fetches number of scripts
/// </summary>
/// <param name="rowIndex">Row index where number of scripts would be placed</param>
private void DisplayNoOfScripts(int rowIndex)
{
 int totalScripts = 0;

 string filterScript = string.Format(@"{0} NOT LIKE NULL"
  , Admin_Script.script_name.ToString(),);

 DataRow[] dr = dtScripts.Select(filterScript);

 totalScripts = dr.Length;

 dgvCategoryCountry.Rows[rowIndex].Cells[COL_DETAIL_SCRIPTS].Value = totalScripts;
}

Read more ...