Showing posts with label Layouts Only. Show all posts
Showing posts with label Layouts Only. Show all posts

Thursday, March 11, 2010

The Layout Template "Edit HTML" Wizard And "Expand Widget Templates"

Sometimes, when we're working on a problem that requires editing the HTML in a layout template, we need to understand the need to expand (or not expand) the widget templates. This month, for instance, we have hundreds of blogs containing malicious code, unknowingly installed by the blog owners. The malicious code must be removed, but the installed code aggressively prevents use of the "Page Elements" wizard, and the "Remove" button.

Note: The selection to "Expand Widget Templates" has been replaced, by folded lines of code, which are now expanded selectively.

When the "Page Elements" wizard can't be used to remove code, you have to use the "Edit HTML" wizard, and remove the individual gadget entries, one by one.

Here's what the unexpanded line entry for one problem gadget looks like
<div class='widget Gadget' id='Gadget1' />

That's easy enough to find - and to delete.

Here's what that entry looks like, expanded. To examine, and maybe modify, the gadget code, you have to select "Expand Widget Templates". To simply remove an entire gadget, on the other hand, do not select "Expand Widget Templates".
<div class='widget Gadget' id='Gadget1'>
<h2 class='title'>Maukie - the virtual cat</h2>

<div class='widget-content'>
<script type="text/javascript">
if (!window.gadgets || !gadgets.rpc) {
document.write('<script type="text/javascript"' +


'src="http://www.gmodules.com/gadgets/js/rpc.js?v\x3d9261b340ef5af1e5faca55914670c7\x26container\x3dblogger\x26debug\x3d0\x26c\x3d1">'

+
'</scr' + 'ipt>');
}
</script>

...


</span>
</span>
<div class='clear'></div>
</div>


OK, the example above was heavily excerpted. If I was to include the entire code set for this one gadget, I would risk this post (my main page display) being subject to segmentation, caused by Auto Pagination. So, I gutted 95% of the interior code. But, you should get the idea.

The point is, when you need to remove malicious code, do not select "Expand Widget Templates". Then, find (as an example)
<div class='widget Gadget' id='Gadget1' />

and delete that one line.

Problem solved.

And next time, be more selective what gadgets you install in your blog.

>> Top

Sunday, February 21, 2010

A Template For Virginia USA #2

For Christmas (End Of Year) 2009, I went back to Virginia again, for a brief visit. What I found, besides the snow (and there was too much of that) were some positive notes. The State Of Virginia USA really is moving into the future. For us Californians (Yes, I consider myself a Californian) they now have a Frys Electronics, a Trader Joes (2 of them in the Richmond area!), and an In-N-Out Burger (No, they don't have that yet!). OK, I'll settle for 2 out of 3.

The point is, Virginia really is moving ahead, into the future. And this month, some bloggers are feeling the need to do that. Two changes in Blogger - Auto Pagination, and the approaching end to FTP Publishing, will both hasten the end to classic templates, and make the move to layout templates more natural.

Owners of blogs with classic templates have, for a long time, been asking about how to get "Newer Posts" / "Older Posts" links for their blogs. That's not a feature that can be provided, in HTML, unfortunately. The "Newer Posts" / "Older Posts" links have to be dynamically generated, so they can't be part of HTML based templates.

This week, we're seeing a new need for the "Newer Posts" / "Older Posts" links. Owners of blogs subject to restriction in archive or main page size, thanks to Auto Pagination, report inability to get all posts indexed by the search engines, or viewed by their readers. Neither main page view, nor individual archive page views, will consistently display all posts in a single page. Without "Newer Posts" / "Older Posts" links, all posts can't be indexed or viewed.

Without the dynamic display that's part of a blog with a layouts template, your blog won't have "Newer Posts" / "Older Posts" links, and won't provide indexing or viewing of all posts in an archive or main page. Nor will the blog have a dynamic labels index.

Now, blogs that use classic templates, and have large or complex posts, are just broken. When support for FTP publishing ends next month, there will be no more blogs that absolutely must use classic templates.

No support for FTP published blogs = no need to support classic templates.

XML based layouts templates are now reality, in Blogger blogging. It's time to move ahead, Virginian bloggers.


That said, I am suggesting that you provide details about your problems, so Blogger may be able to fix your problems.

Friday, February 5, 2010

Duplicate Blog Posts? Remove The Duplicate!

As a savvy consumer, you likely love to hear about offers for 2 for the price of 1, of something that you buy frequently. That's a great deal, normally.

It's not for blog posts, though.

When you start to see double in your blog, chances are that you duplicated the Blog Posts entry in the template. It's not hard to fix, fortunately.

Edit the blog template, using the dashboard Template - "Edit HTML" wizard. Do not expand or unfold any widgets.

If you unfold either 'Blog1' or 'Blog2', you will have to find the end of the unfolded gadget section, which could be hundreds of lines later. If you delete 1 too many, or 1 too few, unfolded lines, you will get a syntax error.
Error parsing XML: ... The element type "b:section" ...
Deleting just one line (see below) is way easier, believe me.

Look for two lines, in the Body of the template, which may or may not be immediately next to each other in sequence:

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

...

<b:widget id='Blog2' locked='true' title='Blog Posts' type='Blog'/>
Remove:
<b:widget id='Blog2' locked='true' title='Blog Posts' type='Blog'/>
Leaving:
<b:widget id='Blog1' locked='true' title='Blog Posts' type='Blog'/>

Save the change. You will get a stern warning when you save, demanding that you confirm that you really want to delete "Blog2". Obviously, you do. And don't forget to clear browser cache, and restart the browser, to reliably test your change.

Remember to save a copy of the template, before and after doing this.

And now, since you're here, and if you just removed a duplicate post template from your blog, help me to help others, and think why you're here.
  • What changes have you made, to the blog?
  • What accessories have you installed?
  • Any templates - Blogger or third party? - installed?
  • Any changes between classic and layout templates?
  • What Blogger features / wizards do you use?
    • Draft Blogger?
    • New, or Old, Post Editor?
  • What third party services have you ever allowed to access the blog directly, to install something?
Solving this problem starts with you.

>> Top

Sunday, September 14, 2008

Removing the "Subscribe to:" Caption / Link

Not everybody who produces a blog, and not even everybody who produces a blog and provides a feed, likes the caption / link at the bottom of the posts column
Subscribe to: Posts (Atom)
or
Subscribe to: Post Comments (Atom)
Some folks think this feature makes the bottom of the posts look cluttered. Maybe they're right.

Fortunately, it's not hard to remove.

First (and I always advise this) Backup Your Template. Next, From the Template Editor, select "Expand Widget Templates". Look through the code for "nextprev".
<!-- navigation -->
<b:include name='nextprev'/>

<!-- feed links -->
<b:include name='feedLinks'/>


Remove just one line.
<!-- navigation -->
<b:include name='nextprev'/>

<!-- feed links -->



Save. Test. Finally, Backup Your Template, again.

Navigate» Become author for this Blog