Auto Hide Notification Box in Blogger

Notification boxes in blogs can be useful for notifying readers about something hot on your blog. But this notification box is a bit different from others, it hides automatically after a specified time.
You may find lots of tutorials about these types of notification boxes but this one is different. It hides itself after a specified time which is the best thing about this. It won't remain there on the page forever (which can possibly disturb the reader not interested in notifications).

Before we proceed to the tutorial check what you are going to add to your blog. 
Demo

Proceed to the tutorial to know how to add it to your blog.

The HTML


The first thing we need is the HTML code as always. The code is simple and you can edit its content easily to make it ready for your blog. This is the HTML snippet

<div id='float-bar' style='display:none;'>
<b class='notifyTextbld'>Notification:</b>
Hello! Welcome to our blog and blah blah blah. See this new post <a rel='nofollow' href='http://stramaxon.com'>Cookies!</a>
</div>
The box contains bold text "Notification" and below it is some message you want your readers to see. You may also include an anchor link to a post or website you want the readers to visit.

Edit the HTML

You will need to edit the text (on line number 3) to display your own message. You know how to do it, just replace the sample text with your own meaningful message. It also contains an anchor link :

<a rel='nofollow' href='http://stramaxon.com'>Cookies!</a>
If you want your readers to visit a page then you can add your own HTML anchor links or any element, you can even add images inside it.

If you are not familiar with HTML but want to add different HTML elements use the Blogger post editor to set the elements in a graphical user interface, switch to the HTML tab, copy the HTML and paste it in the third line of the HTML.

Add the HTML

To add this HTML you have to edit your template HTML so it's good to backup your current template.

We can add this HTML anywhere in the template (inside body element) but to make sure it doesn't interfere with any other element in the template it is best to add it below everything. Follow this steps to do that :
  1. Go to your Blogger Dashboard
  2. Click on the Template tab
  3. Press the Edit HTML button, ignore the warning and proceed. 
  4. Now open the in-page search function in your browser (default CTRL+F)
  5. And search for </body> 
  6. When you find it, paste the HTML code just above it and save the template. 
Once done, check your blog for the HTML (it might be at the bottom), it may look dull, to make it beautiful we will need the CSS. So proceed to the next step.

The CSS

Yeah, this is what gives life to dead HTML skeleton.  The following CSS will be used to style the notification box.
#float-bar {
font-family:"Lucida Grande", "Lucida Sans Unicode", Verdana, Helvetica, Arial, sans-serif;
background-color:rgba(248, 248, 248, 0.85);
color:#000;
padding:10px 30px 30px 30px;
font-size:16px;
position:fixed;
right:10px;
top:0px;
width:500px;
border-radius:0px 0px 10px 10px;
z-index:99999;
}

#float-bar a {color:#000;}
#float-bar a:hover {color:#000;text-decoration:none;}

#float-bar .notifyTextbld {display:block;margin-bottom:20px;}

Editing the CSS

You might want to modify the codes. Edit the values in the highlighted lines.
  • Line 3: This the background color of the box. Replace the value with a rgba color value (with alpha transparency) or HEX color code. 
  • Line 4: This is the color of the text inside the notification box. Use HTML Color Picker to choose a HEX color code  
  • Line 6: This is the size of font inside the notification box. Change the 16px to a desired value.
  • Line 8: You can edit both the property name and its value. Change right to left if you want the notification bar to appear on the left side. And also you can change the 10px to a some other value, this decides how far the box should be from the position. 
  • Line 9: The number of pixels you can the box to be far from the top. 
  • Line 10: This is the width of the box. Change the pixel value if you want.
If you know about CSS (it's easy) you may try adding for removing properties to design your own different box.

Adding the CSS

Check this tutorial to learn how to add CSS in Blogger
http://stramaxon.blogspot.com/2012/03/how-to-add-css-to-your-blogger-blog.html

The JavaScript jQuery 

The final step is to add the JavaScript jQuery script. The script controls how the box should enter and exit. We can do a lot of things with it but for now we will just do the basic in and out stuff.

Including jQuery Library

If you already have jQuery library installed then skip this step. If not then copy the HTML line below :
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
To add this in your template : Go to your Blogger Dashboard -> Template -> Edit HTML -> Search for </head> and paste the code just above </head> and save the template.

Now you may proceed to the next step.

The jQuery Script

This is the script you need.
<script type='text/javascript'>
$(document).ready(function(){
$('#float-bar').slideToggle(445,function(){
$(this).show(function(){
setTimeout(function (){
$('#float-bar').slideUp(445);
},5000);
});
});
});
</script>
You don't need to change anything in this script expect the number of seconds you want the notification bar to stay on the page.

The line number 7 contains a number value 5000 which is the number of milisecond after which the box will disappear. 1000ms = 1sec, so just change the value to set a different time for it to hide. If you want the box to stay on the page for 20 seconds you may change the value to 20000

Adding the Script

The procedure to add the script is same as adding the HTML in the body. To add it go to your Blogger Dashboard -> Template -> Edit HTML -> Use CTRL+F and find </body> in the template and then paste the jQuery code just above </body>.

Showing it just on Homepage

You might not want this notification bar everywhere so the question how do you set it to just display on homepage, post pages, or an index page and archive pages.

The best way to do this is to use Blogger conditional tag (which works on the backend) which will make the box render only on the page type you specify.

The code we will need is this
<b:if cond='data:blog.url == data:blog.homepageUrl'>
//The HTML/JS/CSS or any code you want.
</b:if>
Replace the 2nd line in this code with the HTML code of the notification box and then add it to your template as instructed in in the tutorial. All we did is added the <b:if> conditional tag around the HTML code provided in the tutorial.

Now check your blog for the new notification bar. How is it ? I hope you liked it but if you found any error in the code then do post it in the comments. Thanks.

Fighting MALICIOUS_JAVASCRIPT Notice in Blogger

There have been many cases where a user's blog got deleted because of Malicious Javascript. It's frustrating to get your blog deleted but it's just down for a review. Read why it happens and how to prevent it.
Blogger is one of the most popular CMS and the as it's free, spammers love to target their victims using Blogger blogs. Spreading malicious software and viruses has become easy for spammers and thus blogger blogs are becoming a weapon for those evil spam spreaders. The Blogger platform was already secure as it doesn't allow the user to access server side configurations but yet the spammers can use JavaScript to trick their victim and infect their system with malware etc.

Keeping all these things in mind, blogger created a better spam detection system checks blogs for JavaScripts which redirects or does any other weird tasks and take down the site for safety of the readers.

I am not a spammer! Why my blog got deleted?

The spam detection system scans the blog for any suspicious scripts which can be a possible threat and then takes it down as I already said. It doesn't have anything to do with your profile.

Usually spammers add JavaScript that does a redirect to a site or link to a virus, which infects your system and can do anything the virus creator wants it to do. But recently many normal blogger users' blog were taken down for MALICIOUS_JAVASCRIPT as many users use scripts and codes from external site without knowing what exactly it does. For example, when blogger introduced country specific redirection and a blog posted a script that stopped country specific redirection (which actually redirects the blog URL adding /ncr at the end). Here's the snippet of code used :
var blog = document.location.hostname;
var slug = document.location.pathname;
var ctld = blog.substr(blog.lastIndexOf("."));
if (ctld != ".com") {
var ncr = "http://" + blog.substr(0, blog.indexOf("."));
ncr += ".blogspot.com/ncr" + slug;
window.location.replace(ncr);
}

The blog that published this article is quite popular and many blogger users used this code to stop country specific redirection. This is an example of scripts which can get blog deleted.

How do I restore my Blog?

Blogger spam detection and review system has got better. It now provides option for users to submit their blog for spam review.

If you see a notice for your blog that indicates that your blog has been removed, you can now take action to restore it. Blogs deleted by spam detection system now will appear in the Deleted Blogs section in the Dashboard.

Log into your Blogger Dashboard -> and click on Deleted blogs on the left hand side

All your deleted blogs will be on that page, and the blogs deleted for spam and malicious javascript there will be a Restore button next to the blog name. It will send the blog for review to Google/Blogger Spam experts. You will get the reply within 48 hours.

Now beware of of JavaScript codes on the internet, not all of them are spam but before adding them check what people are discussing about it, is it okay to use or has any problem. 

Header Animating Entrance Effect for Blogger

Not only for blogger but every one using HTML and web languages to display their blog or website. This is a small animating effect created using CSS3 to give an exclusive look to your website.
The new CSS transform and animation can create awesome effect if used the correct way. And being a web designer who is still learning I get to learn about new techniques everyday but I don't always share it on my blog for blogger users who are not experts in using these technologies. I decided to post at least one add-on effect for blogger users every week and this is the first one.

In this tutorial I will tell you how to make an animated entrance effect for the blog's title heading in blogger (can be used on any site by using the correct selectors). Here's the demo and file download link.
Preview Download File

To add this to blogger follow these instruction below

Adding the CSS

In most of our tutorials we first add HTML and then the CSS, but here will add the style code before editing the HTML. The CSS we need to create this entrance effect, is a long code, but don't worry, it won't slow down your site.

Here's the code we are going to use :
/* Animation Effect - Credit goes to Dan Eden @_dte */
@-webkit-keyframes flipInY {
0% {
-webkit-transform: perspective(400px) rotateY(90deg);
opacity: 0;
}

40% {
-webkit-transform: perspective(400px) rotateY(-30deg);
}

70% {
-webkit-transform: perspective(400px) rotateY(10deg);
}

100% {
-webkit-transform: perspective(400px) rotateY(0deg);
opacity: 1;
}
}
@-moz-keyframes flipInY {
0% {
-moz-transform: perspective(400px) rotateY(90deg);
opacity: 0;
}

40% {
-moz-transform: perspective(400px) rotateY(-30deg);
}

70% {
-moz-transform: perspective(400px) rotateY(10deg);
}

100% {
-moz-transform: perspective(400px) rotateY(0deg);
opacity: 1;
}
}
@-o-keyframes flipInY {
0% {
-o-transform: perspective(400px) rotateY(90deg);
opacity: 0;
}

40% {
-o-transform: perspective(400px) rotateY(-30deg);
}

70% {
-o-transform: perspective(400px) rotateY(10deg);
}

100% {
-o-transform: perspective(400px) rotateY(0deg);
opacity: 1;
}
}
@keyframes flipInY {
0% {
transform: perspective(400px) rotateY(90deg);
opacity: 0;
}

40% {
transform: perspective(400px) rotateY(-30deg);
}

70% {
transform: perspective(400px) rotateY(10deg);
}

100% {
transform: perspective(400px) rotateY(0deg);
opacity: 1;
}
}

.flipInY {
-webkit-backface-visibility: visible !important;
-webkit-animation-name: flipInY;
-moz-backface-visibility: visible !important;
-moz-animation-name: flipInY;
-o-backface-visibility: visible !important;
-o-animation-name: flipInY;
backface-visibility: visible !important;
animation-name: flipInY;
}

.animated {
-webkit-animation-duration: 1.4s;
-moz-animation-duration: 1.4s;
-o-animation-duration: 1.4s;
animation-duration: 1.4s;
-webkit-animation-fill-mode: both;
-moz-animation-fill-mode: both;
-o-animation-fill-mode: both;
animation-fill-mode: both;
}

You know how to add this CSS in your blogger blog. Or if you don't know, then this post will help you http://www.stramaxon.com/2012/03/how-to-add-css-to-your-blogger-blog.html

Thanks to Dan Eden for creating such good effects with CSS animation and transform, Here are some more animation effect on his site http://daneden.me/animate/

The first step in order to add this effect is complete, now you need to do some HTML edits to make it work. See the next step.

Editing the HTML

To animate the entrance of your blog's title heading, we have to edit its HTML in the template. To do that go to your Blog Dashboard -> Template -> Edit HTML -> Check mark Expand Widget Template -> Now use CTRL+F to find the following code
<h1 class='title' style='background: transparent; border-width: 0px'>
<b:include name='title'/>
</h1>

The code on your template might look different if you have enable background images or other settings, but the code will always contain the b:include wrapped inside it. Find it using the first few letters of the code you will find it.

Now change add animated flipInY in the class attribute of the heading element <h1 class='title' the code should look like this (notice the first line)
<h1 class='title animated flipInY' style='background: transparent; border-width: 0px'>
<b:include name='title'/>
</h1>
Note: The HTML code is two times in the template, you have to edit both codes.

Not only blog's header but you can do this for any element on your blog page just by adding animated flipInY as class name to the element.

Tell us how did you like this effect in the comments. 

Hover Effect Button using CSS3

I have been using this hover button on my blog for Demo links. Some of the readers on this blog requested me write a tutorial on making something like this. So, here's the tutorial!
If you don't know what button I am talking about then this is what you are going to make after reading this tutorial :
Hey! Hover me to see the effect

How is it? Lovely, isn't it? If you are a Gmail user then you probably know where this design came from, yup this design is from the Gmail's loading bar. I created the design for buttons when my internet was super slow, I had nothing else to do rather then watching the Gmail's loading bar, so I opened up my developer tools and the notepad, wrote all the CSS properties and next I gave it a hover effect to make it look good and it was ready.

You can also make buttons like this on your blog or website using some small lines of CSS and HTML. Read the following steps to add the button to your site :

The CSS for button

We first need to apply a CSS rule for the buttons to give it style. This is the CSS you need to add to your site :
.mjButton {
color:white !important;
background-color: #6188F5;
text-decoration:none !important;
background-image: -webkit-linear-gradient(315deg,transparent,transparent 33%,rgba(0, 0, 0, 0.12) 33%,rgba(0, 0, 0, 0.12) 66%,transparent 66%,transparent);
background-image: -moz-linear-gradient(315deg,transparent,transparent 33%,rgba(0, 0, 0, 0.12) 33%,rgba(0, 0, 0, 0.12) 66%,transparent 66%,transparent);
background-image: -o-linear-gradient(315deg,transparent,transparent 33%,rgba(0, 0, 0, 0.12) 33%,rgba(0, 0, 0, 0.12) 66%,transparent 66%,transparent);
background-image: -ms-linear-gradient(315deg,transparent,transparent 33%,rgba(0, 0, 0, 0.12) 33%,rgba(0, 0, 0, 0.12) 66%,transparent 66%,transparent);
margin:4px;
padding:8px;
text-transform:uppercase;
text-decoration:none;
border:1px solid gainsboro;
text-shadow:1px 1px grey;
font-weight:bold;
font-size:11px;
background-position: 21px 37px;
background-size: 65px 45px;
-webkit-transition:all 0.7s ease-in-out;
-moz-transition:all 0.7s ease-in-out;
-ms-transition:all 0.7s ease-in-out;
-o-transition:all 0.7s ease-in-out;
transition:all 0.7s ease-in-out;
}

/* Mouseover State */
.mjButton:hover {
background-position: 21px 37px;
background-size: 999px 45px;
}

Just include this CSS style rule in your stylesheet and the first step is done. If you are using blogger then check this guide on Adding CSS To Your Blogger Blog

The HTML for buttons

After adding the CSS code in your site or blog the next step to create the button on your web pages is to add the HTML. This is the HTML for the button :
<a href="#" class="mjButton">hey! click this</a>
Yup the button is an anchor element so you can easily put URL in it to link to pages. If you change the value of class attribute in the <a> element, you also have to change the selectors in CSS to match it with the class of the HTML element.

Adding this HTML line in your webpage should now render a hover effect button just like on my site. If you found any problem, please post it as a comment. 

Note: The button is using CSS3 gradients to create this effect and it's a new technology so it wouldn't work the same on all browsers.


Full Page Background Image in Blogger

Many people wants a full size background image for their blog which is not possible with the basic options provided in Blogger's template designer. But it is possible in blogger with some CSS lines.
Blogger does provide hundreds of customization options in template designer to design the template of a blog in a graphical user interface and it's very easy to use to especially for normal users who don't want like to work with codes to design their blog. But it doesn't however provide all the options for design so the only way left is using CSS manually.

Background images in blogger blogs can be changed and customized from the template designer but the options for background image is limited and you can't make much changes. Many blogger users want their blog to have a full sized background image that covers the complete background. Before you proceed to the tutorial, check how it gonna look.
   
Preview Demo Download Files

Tutorial

Doing this is very simple, just a small CSS rule needs to be added to the blog but before that you have to do some basic changes in your template to make sure no current CSS rule will override the new style.

Uploading a full size image

The background image you want to use as a full page background should be large enough to cover the entire viewport without getting pixelate. The image shouldn't be too large to be used on a web page and not even too small to be used for a full size background, it should be around 100kb - 150kb.

The CSS

This CSS adds some advanced background image properties that makes the full page background image possible. This is the CSS
html, body {
background: url('bgimage.jpg') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
Just change bgimage.jpg with the URL to your background image. It's the only change you need to make in the code. Now proceed to the next step. 

Adding the CSS to blog

The final step is to add that CSS in your blogger template. To add the CSS, follow the steps :
  1. Go to your Blogger dashboard
  2. Select the Template tab
  3. Click on the Customize button to open Template designer
  4. Navigate to Advance -> Add CSS 
  5. Paste the code in custom CSS box and click Apply to Blog
Now check your blog for the change. If it didn't worked try clearing your caches and then refresh your blog using CTRL+F5 or try adding the CSS directly in the template

Thanks to Chris Coyier

I would like to thank Chris Coyier of csstricks.com for sharing this CSS snippet. If you want to learn CSS and web designing in a fun way then his website is perfect for you. 

Thanks for reading this and if you got help, please consider donating us some pennies to keep this blog running :)

Retrieve Blog Posts from Old Deleted Blogger Blog

You had a blog some years back but then you deleted it, now you want to save those memories but the problem is you can't access the blog as it was deleted, so is there any way to retrieve those blog posts ? Yes it is and in this post I will tell you how.
It happens, we realize the importance of old memories later and then we want it back without any idea of how to get it. Many people use blog as their online public diary (sometimes private) to write about their daily experiences and memories but sometimes you feel that you don't need it anymore and some years later you want your old memories back, all the blog posts you posted you want it back, but the bitter truth will be that you deleted it and have no longer access to it.




Note: Google Reader will be discontinued from 1st July. Without Google Reader this trick will be ineffective. Make sure to backup your Google Reader content here

Enough discussion about the case, coming to the main topic, questions arises that how would you retrieve it the old posts ? Read further to know how

Retrieving back the blog contents

Every blogger blog has it's own feed URL and it's stored automatically on Google's server whenever you post it but when the blog get's deleted, you can no longer open the feed URLs but there's another way to do it :

Use Google Reader

Google reader is activated for every blogger blog by default and the posts fetched from the feed URL and are stored on your account. The most amazing thing about Google reader is that it doesn't delete the post even tough the blog is no longer online or has been deleted.

It's extremely easy to restore contents from your blog using Google reader, just follow these instructions  :
Login to your Google Reader (https://www.google.com/reader/) using your Google Account user details.
Now we need the feed links to access the blog's feed using reader and the feed link is
https://www.google.com/reader/view/feed/http://yourblog.blogspot.com/feeds/posts/default
I am sure you know what to change in the URL, the blog address! Ofcourse, if you want it to redirect to your blog you have to put in the correct URL. For example, if my blog address is http://stramaxon.blogspot.com my feed URL for Google reader should be
https://www.google.com/reader/view/feed/http://stramaxon.blogspot.com/feeds/posts/default
Now copy and paste the URL in your browser's address bar and Google reader page will open with all your post feed from the blog address you provided. Your old memories are back, yay!

Get XML version of your blog feed

Using Google reader you can also retrieve the blog's feed in XML format, it's not human readable but you saving those XML files on your computer you can view it offline using an XML file viewer. It's very useful if you want to transfer all those blog posts to a blog. Let's see how can we do it :

It's same as fetching the post using the feed URL on Google reader, this is also done by using reader but we will access the atom feed of the blog. The URL is:
https://www.google.com/reader/atom/feed/http://yourblog.blogspot.com/feeds/posts/default?n=1000
Just remember to change yourblog.blogspot.com in the address to your blog address.
The n parameter at the end of URL tells the server to return the number of posts defined, in this case it's set to 1000, but if you had more post to restore than that change it to a desired value.

For example I want to retrieve about 200 post from my blog stramaxon.blogspot.com, the URL I need to use would be
https://www.google.com/reader/atom/feed/http://stramaxon.blogspot.com/feeds/posts/default?n=200
Change the URL so it redirects to your blog's feed and load it into a browser, you will see a page with XML markup, right click on the page and click "save as..", save it on your computer as an XML file.
Import it to a blog
These XML files are very useful, you can import it into another blog. To do it in blogger, follow these steps :
  1. Log into your blogger account 
  2. Use the dropdown menu next to your blog title and go to the Settings menu
  3. Go to the Other tab under Settings 
  4. On that page, click on Import Blog under Blog Tools
  5. A popup box will appear, click on Choose/Browse File and browse to the XML file you downloaded and click Import Blog to upload the file. 
  6. Great! Now all the post in that XML file would be uploaded to the blog and you can publish it all with one click. 
It was that easy! Now you know how to restore deleted posts. 

Placing Ads Inside Blog Post Without Affecting SEO

Normally website owners place ads in sidebars, header and/or footer but placing it inside the main article can  boost up your earnings but if is it safe to do that ?
The main content of your blog is the article and that's what the visitors come to see on your blog and placing ads in between the main article can give you a better CTR and better CTRL means more revenue, yup it's a great idea to put ads there but the question is, will it affect the blog's search engine rankings ? Yup, it can. If you put static ads (without JS) then it would affect the rankings and the way Google and search engine views your website, what happens is that the search engine would think that the ads are a part of your main content and it can lead to a complete misunderstanding.

How to make it better?

It's very simple, all you have to do is wrap the ad code in a <aside> like this:
<aside>
//Your Advertisement Script Here
</aside>
Now even being inside the article container it will not be a part of the main flow. For contents that's related to but not the part of the main content use this tag to make Google and search engine understand your content more efficiently. It's a W3C recommendation http://www.w3.org/wiki/HTML/Elements/aside

Where else I can use it?

According to the specs you may use it for content that's related to the main flow but considered separate from it. It includes advertisement (already resolved), related post links, author info, navigation menu i.e breadcrumbs links etc.

It's not only important for search engine optimization but also improves the document layout of your website.

I want to know more about it

Great, there are lots of resources online you may find helpful.
https://developer.mozilla.org/en-US/docs/HTML/Element/aside

http://html5doctor.com/understanding-aside/

Subscribe our blog if you want to see more posts like this :)