Sunday, May 09, 2010

Resetting The Post Template

The posts are the most important part of the blog as a whole - they contain the material which your visitors read, which is generally what attracts them to the blog. Most of the blog content, that's indexed by the search engines, comes from the posts. It follows, then, that the post template is the most important part of the blog template.

When there are problems with the posts or post accessories, and the problems can't be resolved by editing the posts using the Post Editor, or adjusting the various settings in the Blog Posts gadget, the post template is corrupt, or out of date. There are three possible techniques, to resolve problems with the post template.

Resetting the post template is a fairly simple task, when you get used to it. It's done using the "Edit HTML" wizard in the Classic GUI Template Editor - and it's done without Expanding Widget Templates.

Using the "Edit HTML" wizard, look for the "Blog Posts" gadget.
<b:widget id='Blog1' locked='true' title='Blog Posts' type='Blog'/>

"Blog Posts" will probably be in the "Main" section. To be safe, you can simply save the entire "Main" section by copying and pasting its contents into any text file. This will help you put the posts template back, exactly as it was previously.

Here is a sample of a vary simple "Main" section - one with only "Blog Posts". If your blog has gadgets above or below "Blog Posts", your template may or may not be similar.
<b:section class='main' id='main' showaddelement='no'>
  <b:widget id='Blog1' locked='true' title='Blog Posts' type='Blog'/>
</b:section>
This is a fairly quick process, all done from "Edit HTML".
  1. Start out by backing up the template.
  2. Find the "Blog Posts" gadget inside the "Main" section, and remove that one line of code, shown above in red. Be sure to remove the entire line of code - don't leave yourself vulnerable to XML error messages.
  3. A variation on Step #2 is to simply change "id='Blog1'" to "id='Blog2'" - without deleting anything. This may, similarly, force the refresh of the post template, without the need for Steps #6-7.
  4. Save the change.
  5. Confirm the deletion of "Blog Posts".
  6. Replace that one line of code, shown above in red.
  7. Save the change.
  8. Clear browser cache, then test the change. If the problem isn't resolved, try resetting the widget templates.
  9. And finish by backing up the template, again.
  10. And don't forget to clear browser cache, to ensure that the changes are immediately visible.
It looks a lot scarier than it really is. Once you get used to it, it's a 5 minute task - and can save you energy and time, in the long run.

>> Top

39 comments:

Jason Pelham said...

what a mission.... sry but, there's gotta be an easier way, no?

tuva baluba said...

fantastic! it fixed my blog!

Crayon said...

Thank you, you are the awesome-est. It was easy, just got a little nervous when it said "are you sure you want to delete this blog widget," but I saved the template first like you said. No fears. It's not that hard. A little scary, but I got through it and all is better. :) Thx.

Simplegirl said...

Ahhh finally someone who knows how to deal with this problem. My comments were removed from above the blog and back where they belong. Thank you, thank you. You rock!!

Elizabeth Symington said...

I dont understand step 5. What do I replace the code with?

Chuck said...

What do I replace the code with?

Take this out:
<b:widget id='Blog1' locked='true' title='Blog Posts' type='Blog'/>

Save.

Put this back:
<b:widget id='Blog1' locked='true' title='Blog Posts' type='Blog'/>

Save again.

Elizabeth Symington said...

Hi Chuck,
Thanks for answering my question. I understand know what to delete and then paste where. The new problem is that for some reason blogger lets me delete the code you just mentioned in your comment, then it says

"Warning: Your new template does not include the following widgets:

* Blog1

Would you like to keep these widgets on your blog or delete them?
Deleting widgets cannot be undone."

No matter whether I click keep widgets, delete widgets or cancel, the code I just deleted appears on its own. I cleared the cashe and the layout hasnt changed.

What am I doing wrong?

Thank you for your help.

Chuck said...

Elizabeth,

Here is where I strongly appeal you to post this question in BHF: Something Is Broken, or in Nitecruzr Dot Net - Blogging, so we can explore this in a dialogue.

DaisyCrazy said...

I tried to do this but my blog doesn't have a 'Blog Posts' instead I think it has 'Attribution1' should I remove this?
Thanks

Chuck said...

I tried to do this but my blog doesn't have a 'Blog Posts' instead I think it has 'Attribution1'

The 'Attribution' gadget is not relevant here. If your blog has posts, it has a posts template. Please, start a discussion in BHF: How Do I?, so we can discuss. If you wish, post back the URL of the discussion, so I can catch it.

Victor said...

Worked for me, thanks!

Mara Ruiz said...

It won't let me save the changes because it says my XML is not properly parsed.

Chuck said...

It won't let me save the changes because it says my XML is not properly parsed.

Be sure to remove the entire line of code - and make sure that you did not select "Expand Widget Templates".

Anja Alemania said...

I deleted, copied it back in and cleared the cache and still nothing...

Chuck said...

Anja,

You really need to post in BHF: Something Is Broken, so we can figure out what your problem is.

Charalampos Kapetanios said...

It worked!

I spent too many hours, almost lost my day trying to fix this and then I find your blog and this post and it is fixed in a minute!

You are my hero!

Thanks!

Prudent_Ally said...

I've spent over an hour trying to find the line, and figured out I had the Expand Widget Templates on...thank you so much for mentioning that tiny yet important fact!

*I bow to you! lol

Blu11 said...

I tried this but no new buttons appeared and my Intense debate with all my comments disappeared. (I made a backup so I restored it). Is there any solution for us with customized templates? ;-( Or do I have to add a third party widget to do this? Thanks

In.Che said...

Hey! Thanks for your post :) It worked like a charm, and helped me a lot!

Sophia said...

Quite belated but just want to add my gratitude, this seems to have worked perfectly!

Marc said...

I would like to shout out a sincere thank you, so THANK YOU.

I'm using a 3rd party template from Premium Templates and I believe that after trying more than 4 different templates the constant change may have corrupted certain aspects of my xml data.

I have spent countless hours using the other procedures ("expand widgets, search for date:Header) that I'm sure everyone else has seen to no avail.

Then I find this blog and this process is simple and nicely outlined not to mention that it worked like a charm.

Thanks again for reminding us about the K.I.S.S. - Keep It Simple Stupid, principle.

Marc

Robert Bram said...

Thank you - just I needed to shake my blog until the reactions came loose.

Rob
:)

Rose Val said...

Thank you it worked

Forhuntersbyhunters said...

Goog GOD! It worked! YEAH and thank you!

Cork Environmental Forum said...

Thanks a million - took me 5 minutes and really helped me.

Dan Clay said...

Nice one. Works!

Karen Sioson said...

Thank you very very much. The instruction was very easy to understand and it works!

Laurie Monk said...

Perfect, thanks!

Caroline Young: Training Manager said...

Thank you. It works perfectly. The only problem I have that it messed up my Blog Post Template that I have created in Artisteer. Could you please help me how to fix that?

Lyn Armstrong said...

Cheers, thats fixed it.
Keep up the good work.

KristianK said...

Thanks a bunch. This fixed my "Show Share Buttons" problems.

Sigmar said...

Brilliant, thanks, it worked a treat.

The bloggers always turn out to be the experts, never the company people who are supposed to support the product.

Sigmar

Mike Williams said...

I'm just joining the chorus: Thanks so much. It works perfectly now!

charity said...

Worked! Thanks so much!

Trouble Maker said...

Thank You Chuck, it works. But where is the --- " --- code?

Elysian Training Ltd said...

Finally - been searching for this fix for AGES!!!! thank you

Sandra (Cherry Heart) said...

This worked beautifully - you're the best!

Joe E. Holman said...

Worked perfectly with Simple Template. I just turned "Blog1" to "Blog2" and when it asked me if I wanted to delete Blog1, I said yes (after previewing it first in a test blog before trying it on my real blog). I could already see that everything with regard to posts and dates/labels gone had been fixed!

Thanks!

(JH)

Seyhan Çelik said...

Thanks a lot for this, it worked very well. I preferred to rename the Blog1 to Blog 2 and then back, the other method (removing the line and pasting it back) gave me errors. Fortunately I was trying it on a test blog so no damage.