Blogger Classic Templates Bugs and XHTML
If you're using blogger on your own domain then you're using the classic templates. There is a known issue with the template tag that causes Blogger to emit unwanted JavaScript - this causes havoc, especially if you're using the tag in the section of a page.
Google recommends using the <$blogpagetitle$> tag in the page title. This works, but it's not great from a usability or SEO perspective. For item pages you get the post title after the blog name and you probably want to put the post title first - the earlier that keywords appear in the title the better for search engine ranking.
Luckily there's an easy fix - just comment out the closing Blogger tag:
This doesn't interfere with the template rendering correctly and the JavaScript is then commented out on the rendered page. It's still an unpleasant bug, so if you use the classic templates please report it here and also star or comment on this forum topic to encourage Google to fix it.
If you use labels then Blogger includes them in a paragraph rendered with <$blogitembody$>. This means that wrapping <$blogitembody$> in a paragraph will cause XHTML validation errors for posts with labels because you can't nest another block element inside the paragraph.
The other XHMTL nasty I fixed was the post comments link. My template used the recommended Blogger code:
p>a href="$BlogItemCommentCreate$>"
$BlogItemCommentFormOnClick$>>Post a Commenta>p>
This renders as:
p>a href="https://www.blogger.com/comment.g?blogID=12345678&postID=1234567890123456789"And you end up with a gazillion cascading XHTML errors, all caused by the illegal ampersand. I fixed this by constructing my own comment URL using the <$blogitemnumber$> tag (this emits the unique Post ID):
location.href=https://www.blogger.com/comment.g?blogID=12345678&postID=1234567890123456789;>
Post a Commenta>p>
p>a href="https://www.blogger.com/comment.g?blogID=12345678&postID=$BlogItemNumber$>">$blogitemnumber$>$blogitembody$>$blogitembody$>$blogpagetitle$>
Post a Commenta>p>
Related Posts
- Migrating from Blogger to BlogEngine.NET
- The curious case of the missing slugs (in BlogEngine.net 2.8)
- Commentary
- How to get SEO credit for Facebook Comments (the missing manual)
- Converting Blogger ATOM export to BlogML
(Published to the Fediverse as: Blogger Classic Templates Bugs and XHTML #code #ithcwy How to solve Blogger Classic Templates Bugs and XHTML )
Comments
Ditto above. Thank you!
Add Comment
All comments are moderated. Your email address is used to display a Gravatar and optionally for notification of new comments and to sign up for the newsletter.