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

Blogger: Changing Templates without Loosing Widgets

Blogger: Changing Templates without Loosing Widgets


The other day when I was trying to change the Template of this blog I faced
a rather disheartening problem. Blogger said that all the Widget along with
their data will be lost when changing to a third-party template. As you can
see I have a link list (big one) on the sidebar, it has links to all my posts
so far (>180!), man could I afford to loose that? Of course NOT!


Good thing was switching to one of the templates provided by Blogger wouldn’t
make me loose those widgets. Bad thing is I don’t like those templates.
Those are all too old, excessively used everywhere and 2-column ones.


So what did I do to save my widgets when changing to a third party Blogger
template? Read along to know…(this might look like a crappy landing page
that’d sell you something, believe me its NOT!)


If you too are facing the same problem you can take these steps to save your
widgets:


STEPS:


1. Start off by going to Layout-> Edit HTML then click
on Expand Widget Template check box.


2. Search for <b:widget
in the template code and copy the widget section code.

e.g.:


...
<div id='sidebar-wrapper'>

<b:section class='sidebar' id='sidebar' preferred='yes'>

<b:widget id='HTML1' locked='false' title='Search this
Blog' type='HTML'>

<b:includable id='main'>

<!-- only display title if it's non-empty -->

<b:if cond='data:title != &quot;&quot;'>

<h2 class='title'><data:title/></h2>

</b:if>

<div class='widget-content'>

<data:content/>

</div>



<b:include name='quickedit'/>

</b:includable>

</b:widget>


<b:widget id='LinkList1' locked='false' title='Recent Posts' type='LinkList'>

<b:includable id='main'>


<b:if cond='data:title'><h2><data:title/></h2></b:if>

<div class='widget-content'>

<ul>

...


Do it as many times as needed to copy all the widgets. Paste them one after
to other in Notepad. You can leave the unnecessary ones such as Header, Blog
(There is a widget for this too, shows the posts) etc. the code of which would
look something like below:


No need to copy these:



  • <b:widget id='Header1' locked='true' title='For Testing Purpose
    (Header)' type='Header'>

  • <b:widget id='Blog1' locked='true' title='Blog Posts' type='Blog'>


3. Now copy the new template code by opening the XML
file in another Notepad. Paste it in Blogger deleting the old template code.


4. Find the following line in the newly pasted template
code:


...
<div id='sidebar-wrapper'>

<b:section class='sidebar' id='sidebar' preferred='yes'>

[--PASTE WIDGETCODE HERE--]


5. Paste all the widget codes previously copied there
right after the <b:section line.


6. Save the template.


7. If you had not copied some unnecessary widget codes
from the original template, Blogger might ask you to confirm their deletion.
Confirm this and SAVE the template.


8. Done!


Doing this you’d save existing widget from getting deleted when switching
template but the widgets will NOT be arranged or placed in any meaningful manner
(they’d all be in a sidebar). To re-arrange them in the manner you want
just go to Layout-> Page Elements and drag drop the widgets as required,
click save. You’re done!


Blogger: Changing Templates without Loosing Widgets  - Rearrange the Widgets


Previous Posts:


Blogger: Method to Add 'Link to This Post' Widget on Your Posts

Blogger: Method to Add ‘Link to This Post’ Widget on Your Posts


[Today I’m going to provide you with a code that
you can put on your Blogger Blogs. It’ll give your visitors a very easy
way to link to your posts if they like it. Scroll to the bottom to see it in
action! You might also want to read New
Working Method of Making Blogger Title Tags SEO Friendly
]




When it comes to Search Engine rankings, link popularity is no doubt one of
the most important factors especially organic link popularity.


Nowadays Search Engines’ algorithms have become so intelligent and sophisticated
that they could differentiate between different types of links; paid, reciprocal,
organic etc. to name some, automatically and not let discouraged factors manipulate
rankings much (in some cases by even penalizing those site).


Coming to Organic Link Building, there is no better way to do (or at least
increase) Link Building than to ask or encourage your visitors. You see, I’ve
it at the bottom of this post. This way you are asking peoples for links as
well as providing them with the HTML code to ease the process a bit. Now if
peoples like our post or site and HTML code is what they have to copy and paste,
you stand a better chance of getting links than with many other techniques.
One more BIG advantage is that as the code would generate anchor text (text
of the hyperlink) same as the post title, again odds are that you’d get
your main and relevant keywords in the links; rather than ‘this great
post’ which some peoples prefer!


Below is the code that does this:



<!-- By Arvind Gupta -- http://learning-computer-programming.blogspot.com/ -->

<div align='center' style='border: 1px solid #646464; padding: 10px; margin: 20px;'> 


<p style='font-size: 150%; background: #C8C8C8; padding: 5px;'>Show Some Love!</p>

<p>If you like this post please consider 


  making a reference to it from other Blogs, Forums, Profiles etc. by copying 

  and pasting the following HTML code. Thank You!<br/>


  <br/>

<textarea cols='40' id='bloglinking' name='bloglinking' onFocus='select()' rows='3'>&lt;a href=&quot;<data:post.url/>&quot;&gt;<data:post.title/>&lt;/a&gt;</textarea><br />


    <!--My Link-->

    <font color="#999999" size="1"><em>Link To This Post </em>Widget by <a href="http://learning-computer-programming.blogspot.com/">Learning 


    Computer Programming</a></font></p>

    <!--/My Link-->

</div>



First, you may want to change text so as to be unique in asking people to link
to you ;-).

WARNING: You must not delete my link though… Nah! Just kidding, YOU CAN
DELETE IT if you wish to.


Now you are ready with code, open your Blog’s Dashboard move to Layout
-> Edit HTML
, tick Expand Widget Template check
box. Now there are two places where you can place it, either at the top or at
the bottom (like mine) of the post, I personally prefer it at the bottom.


To place it at the TOP, find some code that looks like below (in the middle
of the code listing):



...

...

<div class='post-header-line-1'/>



<div class='post-body'>


[--PUT THE CODE HERE--]



<p><data:post.body/></p>

<div style='clear: both;'/> <!-- clear for photos floats --></div>

<div class='post-footer'>


<p class='post-footer-line post-footer-line-1'><span class='post-author'>

<b:if cond='data:top.showAuthor'>

<data:top.authorLabel/> <data:post.author/>

</b:if>

...

...



And place our code as and where stated.


To have it at the BOTTOM, paste the code in a slightly different place as::


...

...

<div class='post-header-line-1'/>


<div class='post-body'>

<p><data:post.body/></p>

<div style='clear: both;'/> <!-- clear for photos floats --></div>

<div class='post-footer'>


[--PUT THE CODE HERE--]


<p class='post-footer-line post-footer-line-1'><span class='post-author'>

<b:if cond='data:top.showAuthor'>

<data:top.authorLabel/> <data:post.author/>

</b:if>

...

...



Previous Posts:


New Working Method of Making Blogger Title Tags SEO Friendly

New Working Method of Making Blogger Title Tags SEO Friendly


[Blogger made some recent changes on 9th May 2008 which
enables us to use a simple method to make SEO Friendly Title Tags for Post Pages
(Permalink Pages), I guess I am a bit too late to notice but as we’re
discussing about Web Programming lately, I’ll share the method anyway.]


One of the biggest problems I face with Blogger blogs is the inability to create
custom SEO and human friendly title tags. Blogger does not give us any option
to change the way title tags are in post pages. Titles of post pages in Blogger
are always in the following form:


[Blog Title] : [Post Title]


In this case when you have a bit long Blog Name, all your pages in the Search
Engine index would start with the blog name taking most of the previous space.
That way it wouldn’t be relevant to the content of the post in most cases


The following form of title would be considered good:


[Post Title] : [Blog Title]


Or if your blog’s name is too long you can use just the title:


[Post Title]


People have always been trying to come up with ways to create custom title
tags in Blogger, some used a hack few months back known as the Widget Based
Title Tag hack which NO longer works from quite some time. Even I used that
method here on my blog. But, as I said, after sometime Blogger wouldn’t
let that hack work. Again some people found a slightly different method that
WORKED but pissed off the HTML compliance really bad as title tag was placed
outside of the <head> tag. So the fact is before 9th May there really
was no way you could have custom titles and those who already had the hack working,
couldn’t edit the Template code anymore without switching back to the
normal title structure.


The Method


Below I’m outlining a very simple and 100% working way of having custom
titles in Blogger:


<b:if cond='data:blog.pageType == &quot;item&quot;'>

<title><data:blog.pageName/> | <data:blog.title/></title>

<b:else/>

<title><data:blog.pageTitle/></title>

</b:if>


Copy and paste the above code replacing the <data:blog.pageTitle/>
line in your template code.


Or if you want the posts to have just the post title in the title tag and NO
blog name or if your blog name is too long, you may use the following code,
again replace <data:blog.pageTitle/> line with this code.


[Go to Layout->Edit HTML to place these codes.]


NOTE: Titles of pages are very critical when it comes
to Search Engines not just from SEO point of view but also from human perspective.
It’s a known fact that even if your website ranks higher but has irrelevant
(same looking titles) for all the pages, chances are peoples would rather click
on lower ranking pages having relevant titles.

Check out this stream