Powered by Blogger.
Menu :
Showing posts with label Template editing. Show all posts
Showing posts with label Template editing. Show all posts

Google's guide to HTML and CSS styles

Google have released their own style guide for HTML and CSS code.

It will be interesting to see how much of it they apply in future changes to Blogger templates

But for Bloggers who do a lot of modifications to their own template, there might be some useful tips. I especially like the one about putting CSS rules into alphabetical order for maintainability.

Doing this would mean adding CSS rules manually rather than than through Design > Customize > Advanced > Add CSS

And it will be harder to do a code-compare to see the difference between our customized template and the current standard-issue ones.  But storing like-named rules together appeals to me more than just tagging new ones on the end.

Adding gadgets to your mobile-template makes your blog better for smartphone visitors

This article shows how to add gadgets to the mobile version of your blogger template.

Gadgets and mobile templates 

Previously I've described how to add a gadget to your blog.

If you have not enabled a mobile template for your blog, then visitors who look at it using a mobile device (smartphone, tablet etc) will see all your content and gadgets.   But they will probably have to scroll left and right a lot, because your blog will be a lot wider than their screen.  There might be some issues if you have gadgets that require javascript or particular media players, which their device doesn't have installed. But these are exactly the same as the issues for your visitors who are using desktop computers.

But if you have enabled a mobile template, then readers who are using a mobile device see a different design which is tailored to their screen-width, though still using the colour/theme that you chose.

Blogger faced some challenged when they built these mobile templates: many bloggers put a lot of effort into design and providing gadgets that.    But a 300-ish pixel screen simply does not have room for a sidebar and blog content, and may not have space for some of the things that gadgets do, either.

What Blogger have done is to say that only some gadgets are normally shown on mobile-template versions of your blog:
  • Header
  • Blog Posts
  • Profile
  • Pages
  • AdSense
  • Attribution

However it's easy to add other gadgets to your own customized mobile template, and to set up gadgets that are only seen by readers using mobile-devices - provided you are willing to take the risks of editing your template.

(I've described how to remove the attribution gadget from mobile-templates before, because it's one that some people particularly hate - and of course the same approach can be used for the other standard gadgets too.)


How to add a gadget to the mobile template

First, check that mobile has been enabled for your blog, and that your mobile template is set up to show customizations:   go to the Template tab, click on the gear-wheel under mobile, tick Yes (for show mobile template), then select Custom, and press the Save button.


Add the gadget to your blog, in the usual way:  when you are choosing the parameters, make sure you think about the amount of screen-space that your mobile-readers will have to see it.

Find the gadget ID.

Edit your template: you don't need to expand the widgets.

Locate the gadget code, by searching for the ID you found (tip: use your brower's search function, eg ctrl/F). It will look something like this (slightly different, of course, if the gadget you are working on is of a different type):
<b:widget id='PlusBadge1' locked='false' title='Google+ Badge' type='PlusBadge'/>
To show the gadget on the mobile version of your blog, add mobile='yes' to the code, like this:
<b:widget id='PlusBadge1' locked='false' mobile='yes' title='Google+ Badge' type='PlusBadge'/>

To show the gadget only on the mobile template and not to desktop users, add mobile='only' to the code, like this:
<b:widget id='PlusBadge1' locked='false' mobile='only' title='Google+ Badge' type='PlusBadge'/>

Save the changes.

Use either a mobile device (ideally), or another tool that lets you test blogs as they would appear on different screen sizes, to check that the gadgets are showing as you think they should.


What gadgets should you add to your mobile template?

There are no hard-and-fast rules here:   it's all about what you want your mobile visitors to be able to access.   I have seen people add blog-rolls, linked-lists, polls, profiles, and various other simple widgets.

Gadgets that I think could be more troublesome are slideshows, popular posts (if you try to show a thumbnail), newsreel, subscriptions, gadgets from Amazon.com and other 3rd parties.

You just need to remember amount of screen space which your visitors have, and how large the images are likely to be for them.   And also that gadgets are likely to be shown as the bottom of the list-of-posts (which is how the blog-posts gadget shows the home page of your mobile blog), so won't be nearly so obvious as they are in the sidebar.


Why put gadgets only in the mobile blog?

You may wonder why a gadget should only go on the mobile version.

One reason is to provide a simpler alternative to a full-featured gadget that is shown on the non-mobile version of the blog. For example, I use a two-page google-custom-search option here on Blogger-Hints-and-tips. This lets me control what sites are searched, and use some advanced display features. But a mobile-sized screen won't cope with this. So if I wanted to make Blogger-HAT more mobile-friendly, I'd add a regular search-gadget, but only show it to on mobile-devices so that non-mobile visitors didn't get confused.


Positioning gadgets on the mobile template

Tatami layout 1As far as I can see, we do not easily have any control over the positioning of gadgets in the mobile-template versions of our blogs.

Some experiments make me think that:
  • gadgets from the header in the regular layout are put above the list of posts in the mobile view
  • gadgets from the footer in the regular layout are put below the list of posts in the mobile view
  • gadgets from the sidebar in the regular layout are put below the list of posts in the mobile view

But there could be more going on here - please let me know if you've worked out any more rules that are applied.

Also, I have no idea how mobile templates will cope with tricks like gadgets that are put above your header: test your blog extra carefully if you've tweaked your template in this way before adding mobile-specific tweaks.


Troubleshooting

Stopping gadgets from showing on mobile-template blogs (ie adding mobile='no') does not require you to choose the Custom option from the list of mobile template.   But adding them (except for the ones in the default list) does.

The default mobile gadgets are  only shown if you have put them onto your blog template: if they are not in your blog at the moment, then they will not automatically be shown just because you enable a mobile template.

What other problems have you had with mobile-templates?



Related Articles:



Putting a gadget into your blog

Turning your blog's mobile template on

Advantages and disadvantages of editing your blogger template

Finding the id for any gadget

Adding a google-custom-search

Giving your blog a home-page

Finding the gadget ID for a widget in your blog

This article shows you how to find the "identifier" for a gadget in your blog.  This isn't useful in itself, but is a set in various other template customizations, including putting a gadget on a single page only.


Sometimes you need to find the code-name for a gadget that you have added to your blog, so you can edit your template and control how and where that gadget is displayed.

This may be part of giving your blog a home-page, controlling how your blog looks on mobile devices, or various other tweaks.

Luckily this is very simple.


How to find the id-code for any gadget:

"gadget", "widget", and even "page-element" all mean the same thing.  I generally use "gadget", because the Page Elements tab currently says "Add a Gadget".  But they're absolutely the same.


Add the gadget to your blog in the usual way.

Edit it again, but don't make any changes to it.

Maximise the window, so you can see the very end of the address bar in the window - at the top of the screen.

Note the word there, entering in a number.   This is the Gadget-id.

In this example, it's Text1,   Other possible values are HTML1, Attribution1, Followers1, etc.


Picture of the widget-settings window, showing the widget-id in the browser address bar at the end of the address


What does the number mean?

The digits at the end of the widget-id show to the number of times that a gadget of this type has been added to the blog:  in a complicated situtation, with lots of gadgets of the same type, it can get into double, or even treble-figures.)



Related Articles: 




Controlling what goes on the homepage

Adding a gadget / widget / page-element to your blog

Editing your blogger template

Putting a gadget on your static-pages only - or your home page

Options for adding gadgets to your blog

There are (at least) three different ways of adding a gadget to your blog.  This article explains what a gadget / widget is, and looks at the advantages and disadvantages of each method.

Gadgets and Blogs

A gadget is simply a small thing that does "something useful". In real-life, it may be a bottle-opener, screw-driver, pocket-knife, etc.

On your blog, a gadget may be called a  widget or page-element. But it's the same idea: a small piece bit of code that does something useful. You could put a gadget into a post, but usually they're found in the sidebar, header or footer.

There are three main ways to install a gadget into your blog:
  1. The Add a Gadget wizard provided by Blogger
  2. Manually installing the code into your template
  3. Using a customized "add to Blogger" button provided by some 3rd parties who make gadgets for websites

The pros and cons of with each approach are listed here.

Note that adding gadgets to blogs with dynamic-view templates is a little different - the following lists are written with layout or designer templates in mind.


Blogger's Add a Gadget feature

The add a gadget option is a built-in part of the Blogger software. It is the first way that most people add extra useful tools to their blogs.

Advantages
  • Easy to use - you can move items around with just drag and drop
  • Gives access to Blogger's pre-built tools
  • In gadgets built by Blogger, the screen where you enter the details (title, picture location, code, which labels to include, etc) is usually easy to understand: they don't use geeky words like "parameter" (even though this is really what they are asking for on the screens)
  • You have total control over where to put gadgets - you just drag-and-drop them in to place.

Disadvantages
  • You don't have total control over item formatting and placement
  • There is no easy way to back up your settings
  • If you use the same type of gadget many times, and don't give each one a title, it can be confusing to see in the layout which gadget you are working with.
  • There are some gadgets available in the add-a-gadget wizard that did not come from Blogger -and some of them don't work properly. (Google do not guarantee that all the gadets in the list are correct, or that they are free of viruses, malware, etc.)
  • You cannot see the code behind any of the gadgets, so you can never be 100% certin what they do.

Manually installing code into the template:

Adding a gadget into your template is just the same as adding any other code: you need to get the code, and you need to know exactly where to put it.   As well as the usual advantages and disadvantages of editing your template, there are these ones:

Advantages
  • You have total control over item placement, alignment and formatting
  • Code you have installed is fully backed up when you back up your template
  • You can use code from anywhere, not just from Google
  • You can control what pages the gadget appears on, by adding some extra code at the same tim you add the gadget.

Disadvantages
  • You need to get the code from somewhere: either you need to write it yourself, or from a 3rd party that you trust.
  • It's not nearly as easy - you need to edit your template
  • You need to position items using code, drag and drop will not work.
  • You can use code from anywhere, not just from Google - so you might be tempted to use code from dodgy 3rd party sources.
  • If you do make calls to 3rd parties, and they later disappear, then your gadgets will give an odd-looking messages instead of working the way they used to.

Suggestion:
If you are going to install code from 3rd parties, make sure that you read it over first. If it calls pictures, consider making a copy of those pictures youeself, and changing the code to link to your copy instead of theirs. If it has calls to scripts that are hosted somewhere, consider doing the same - but be aware that the downside is that if the code needs to change for a future version of Blogger (or windows), you won't automatically get the new code.

Another option:
If you have the code, then you can also add it to an individual post or page, by pasting it into the HTML table of the editor.  If you link to this from the menu bar, then readers will have a way to get to it from every post, otherwise they will only see it when they see the page/post you put it in.


Use a 3rd party's "add to Blogger" option:

Many websites that let you generate code to do "something useful" also ask you where you want to put that code.

If you choose "a website", they just give you the HTML, which you can install in the normal way.

Choosing "Blogger" in the AddThis gadget window shows a big red "Install Blogger Widget" button

But if you tell them that the code is going into Blogger, they give you a button, or perhaps even open a new window or tab for you, call www.blogger.com, and go into the Add-a-gadget screen and put a gadget with their code into the screen: all you need to do is check that it's ok, move it to a different place if wanted, and press Save changes.

The big advantage of this approach is that it is easy: you don't have to copy-and-paste the code yourself.


Disadvantages:
As well as all the regular disadvantages of adding a gadget using Blogger's add-a-gadget too, there are some specifc ones for this approach:
  • If the 3rd party is dishonest, they may ask you to enter your Blogger ID and password into their site - and you have no guarantees that they won't do nasty things with them.
  • If you have more than one Blog, you may accidentally put the gadget onto the wrong one
  • If your blog is complex, it may be hard to find where on the layout screen the new gadget has been put
  • You don't get an opportunity to look at the code to check if it does strange things.
  • Because you don't look at the code, you cannot make a backup copy of it (and because it's put into your gadgets, a template backup may not include it or the user-settings that you chose).


My Recommendation

There is no "one right way" to install gadgets: some of Blogger's built-in gadgets are very handy, and I make a lot of use of them. But in general:

Usually, I just tell the 3rd party sites that I'm putting their code onto "my website" and install the code that they give me in into a regular HTML/Javascript gadget.  There is a slight risk that this could cause problems if the other company offers slightly different code for Blogger vs regular websites - butI have not yet found a case where this happens.

If you're adding code from a 3rd party, then it's a good idea to store a copy of that code in a documentation blog (or similar), so that you can easily re-cereate it it if the gadget is accidentally deleted.



Related Articles:



How to put posts into your pages in blogger

Using Blogger's widget-addition tool

Advantages and disadvantages of editing your template

Use a private blog to store documentation about your blog

Adding 3rd party HTML into your blog

Templates types in Blogger.

How to edit your Blogger template

This article is about how to edit Blogger templates, using either the old or new interfaces.

It supports many other articles on this site, which suggest specific template changes to solve particular problems.



Previously, I've looked at whether it's a good idea to edit your Blogger template or not.

For many people, editing the template is acceptable, because it is the only way to do what they want (remove the attribution, show a gadget on the homeppage only, add a Facebook like button to posts, etc).


In general, the process to follow is:
  • Open the template-editor
  • Make a back-up copy of the template, as it is now
  • Make the change
  • Check that it works, and if not, go back to the previous template.

Of course it's not quite that simple - there are different procedures for working with dynamic vs designer or layout templates.


How to open Blogger's template editor, for dynamic template blogs:


If your blog has a dynamic template, then use the see-all-posts icon for the blog to get into it the blog-options screen for the blog that you want to edit.

When you are in the see-all-posts mode, the the address bar in your browser is like this:
http://www.blogger.com/blogger.g?blogID=5381944372768369653#allposts/postNum=0

Copy your blogID number - that is, the digits between blogID= and #allposts (it's bold in the example above)

Go go
http://www.blogger.com/html?blogID=NNNNNNNNNNNNNNNNNNN
where you have replacd NNN... with your blogID


Note:  the last time I tried this, it automatically opened in the old interface's template editor.   As always, make sure you take a backup copy of the template - see instructions below before changing this.


How to open Blogger's template editor, for non-dynamic templates


  • Go to the Design tab
  • Click Edit HTML
  • Note:  this step has now been removed - however I've left it here for now, because I suspect that it may come back in future:
    Click Proceed




How to edit your template

Make a backup copy of your current template:

It's tempting to skip this if you're only making a small change. I even skip it myself sometimes. And it's not needed if this is the first time you've ever customised your template - because you can recover from problems by just reinstalling the standard template.

But if you would be upset to lose any template changes you made earlier, or if the change you are making now is not minor, then I strongly recommend making a copy before you start, just in case.  To do this
  • Click the Backup / Restore button near the top right of the dashboard (as shown below)
  • Click the Download Full Template button, and then wait while the file downloads.
  • After the download has finished, find the place where your computer puts downloaded files.
  • Find the file that was just created,
  • Rename it to something sensible
     (eg MyBlog template backup before change 31 Jan 2012.xml)
  • Move the file to somewhere safe: usually somewhere on your computer is fine - or you make like to upload it to somewhere like Google Docs, to be absolutely certain that it won't get lost.





Make the change to your template:

  • Check whether the change you are making needs the Expand Widgets checkbox off or on, and put it to the right state.
    (If the article telling you want to change doesn't mention it, then assume it should be off.)
  • Find the code you need to change:

    See this article from Southern Speakers if you're not sure how to use the find-feature that Blogger have now built into the template editor.

    Note:   many of the "how to" articles say to make sure that the Expand Widgets checkbox off or on.   This checkbox has now been removed from Blogger's template editor.    If the instructions you are following says to leave it "off", then you should just be able to follow it as is.    However if you are told to turn it on, then you need to find the correct part of the code by searching for the widget-id or section name, and then "unfold" that to see the complete code.   
  • Make the change (this article doesn't go into the principles of template design, there are plenty of other articles and websites about that: I'm assuming that you know what you need to do).
  • Click the Preview button:

If Blogger can make sense of the change you made, then a new window or tab opens, showing a view that looks like your blog's homepage. It's not a real copy of your blog (the links won't work, the spacing might not be quite the same, and it will have the word "Preview" diagonally in the top left corner).


Do a quick check that the screen looks right - for some changes you even be able to tell if the change has been successful just from this preview screen.

However:  If the new window/tab shows an error message like
Your template could not be parsed as it is not well-formed. Please make sure that all XML elements are closed properly. <br/> XML error message: The element type "div" must be terminated by the matching end-tag "</div>".Error 500
or
Your template could not be parsed as it is not well-formed. Please make sure that all XML elements are closed properly. <br/> XML error message: Element type "b:widget" must be followed by either attribute specifications, ">" or "/>".
then Blogger has not been able to understand the change you made. Sometimes the error message gives a clue about what's wrong, although it can be misleading.   Check that you made the change correctly - fix any errors and click Preview again.  If it still doesn't work, ask for help from the place that suggested the change you are making.

Once you are happy that the preview screen looks OK, click the Save or Save template button.


How to test your template change:


Some template changes can be checked very easily, sometimes from the preview screen.

But if your change isn't visible on the front screen, you must check it after you have applied it. What to verify depends on your template type, what the change was, and what other features (eg the page-gadget as a menu, the archive widget, ) your blog uses. You need to decide what to test, based on all of these.

At least, I alwways click on and check on these things when I've made a major template change:
  1. the home page
  2. the items in the menu bar
  3. a label value
  4. an archive widget entry
  5. custom-search-engine results
  6. comments

And if I'm being particularly reader-focussed, I'll also check these things in more than one browser:   usually in the current version of Internet Explorer, Firefox and Chrome.


Fixing Problems:


If you find that the template change has caused problems, then ou have have a choice to make:
Can you and your readers live with the problems on your blog for "a while", while you look for other solutions? 
Or 
Do you need to remove the change right now, so visitors can use your blog as it was while you solve the issues.

There is no right answer to this question:   It's a personal decision, based on the blog, and your readers.

But if you do need to remove the template change, here's how to do it:
  • Click the Backup / Restore button near the top right of the dashboard
  • Click Choose File and find the file that you downloaded earlier
  • Click Upload.


It is best to restore your template before you have changed any gadgets.  If you get a message about widgets being missing, then it means that the gadgets associated with your blog are not the ones referred to in the template.   If this happens, you need to decide whether to deep or delete any "orphaned" ones, and may need to check their settings again.


Making complicated changes:


If you your template may need a lot of "surgery" while you figure out how to make a change, then it may be a good idea to build a private test-blog to do the work in, and only copy the contents into your "real" blog template when you are certain that you've got it correct (or correct-enough).




Related Articles:


Advantages and disadvantes of editing your Blogger template

 How to expand the widgets in your template editor.

Adding CSS formatting rules to your blog, without editng the template

How to remove the "powered by Blogger" attribution from designer-template blogs

Putting a gadget on the homeppage only

Planning changes to your blog - without readers seeing what you are doing

Removing dynamic templates from your blog

Dynamic templates can be removed from your blog - but be careful if you want to keep any gadets etc that were on your blog before it went dynamic.


Overview:

Previously, I've described the initial version of dynamic templates for blogger, and the second release.

This 2nd version is a lot better integrated with the rest of Blogger, but it has some consequences for many other parts of the system.

In particular, if you want to go back to using a design or layout template there is a real risk of losing all your previous gadgets if you aren't careful how your remove the dynamic template.


Dynamic view template = no Design option in the dashboard drop down

One effect of choosing a Dynamic template for your blog is that the Design option is not on the main-menu drop down in the dashboard in the new, the post-Sept-11 Blogger interface.


Instead, there is just Template, which takes you straight to the Template designer:  this happens because, unlike layout or designer templates, you have no control over the layout of a blog with dynamic template, and cannot edit the HTML behind it.

If you want to have this level of control, including being responsible for the consequences of editing your template, then you need to remove the dynamic template, and switch back to a regular one.


How to remove a dynamic template from your blog:

When you have chosen a dynamic template, there is an option in the Design screen to " Revert to previous template".


If you click this link, your blog template goes back to how it was before you applied the designer template, including all gadgets and layout customisations.

BUT

If you choose "revert to previous template", and then pick a different designer or layout template before saving, then you will lose all gadgets and customisations that are not on the "standard" version of the new template.

The moral of the story:  always back up before making major changes to your blog.   (And even then I'm not 100% convinced you will be able to restore your gadgets to exactly how they were.)

NB   Any posts you have made in the meantime are kept - it is simply the template that is changed here, not the blog contents.


Disabling dynamic views for your blog:

In new-interface-Blogger, I cannot see any way to turn Dynamic views off.

In pre-Sept-11-Blogger, there is still an option to turn Dynamic views off, under Settings > Formatting.

This is still relevant, because people can see your blog using dynamic views, even if you haven't chosen a dynamic template, by using    www.YourURL.blogspot.com/view   (although this may not work for blogs with custom URLs)



Related Articles:



Dynamic templates, version I

How to enable a dynamic template for your blog

Letting your readers the ability to see your blog in dynamic views.

Advantages and disadvantages of editing your blog's template

Giving your readers the option of using dynamic views

Types of template in Blogger

Dynamic templates: turning them on in your blog

This article is about the 2nd version of dynamic templates that Blogger have released:  what they are, how to add them to your blog, and what restrictions they have.


Announcing Dynamic Templates, part II

In March 2011, Blogger announced Dynamic Views, and I posted describing them, and telling you how to give your readers the ability to see your blog in dynamic views.

Today, they've announced them again (without acknowledging the previous announcement!).  This time with a few differences:
  • There are seven templates (instead of five)
  • Some templates allow for blogs that don't have great photos in every post
  • You can set your blog up so that visitors automatically see it using one of the dynamic-view templates:  it's just another option in the template designer (see Setting up your Blog to use a Dynamic Template, below).
  • Most (all?) templates include some gadgets: search, RSS feed link, link to Blogger, and regular sized +1, Tweet and Like buttons (instead of the anorexic ones in regular designer templates at the moment)

There are still restrictions:  blogs must be public, with RSS site feeds enabled.

And there are still lots of things missing:   for example, blog-owners have no control over gadgets or layout, fonts or color scheme (even though the announcement says this is coming, I cannot find where to access it).



You cannot add gadgets to a blog with a dynamic template.   So you cannot install Google Analytics, or AdSense or any other sort of advertising.  That said, this help article does say that Blogger will continue to support AdSense for blogs that already have it, so the work around may be to use a regular designer template, put in some ads, and then switch to a dynamic template.


Setting up your Blog to use a Dynamic Template

To make a dynamic view the default option for your blog:

1)  Check that it is public,

2)  Check that the RSS site feeds is switched to full or jump-break

2)  Choose Design > Template Designer (pre-Sept-11 interface), or Template from the dashboard drop-down (post-Sept-11 Blogger)

3)  Choose Dynamic from the list of options   (if it's not in the list, then post probably your blog doesn't meet one of the conditions above.

4)  From the row underneath, choose which of the options (ie dynamic template types) you would like as a default.




Next: 

Removing a dynamic template from your blog - be careful, don't lose your gadgets!



Related Articles:



Dynamic templates, version I

Letting your readers the ability to see your blog in dynamic views.

Changing the colours in your blog

Why RSS matters, and how to enable it

Installing Google Analytics into Blogger

Setting up AdSense for your blog

Lining up the first post and the sidebar

In some Blogger templates, there is a big gap between the bottom of the header and the start of the first post, and this means that the posts and the sidebar are not aligned.  This article explains how to adjust the gap, and so remove that problem.



Blogger template layouts

Isométrica a04In the templates that Blogger provides, as well as all third-party templates, the amount of space between elements on the screen is not accidental:   designers put a lot of effort into working out what spacing will look good, and then finding ways to put CSS code into the template so that the spacing they want is shown in any browser software that Blogger supports.
But there are times when you may want to change this spacing, and this is easy to do, provided you are willing to accept the disadvantages of editing your template, and if  you can work out exactly which part of the template code to change.


The pre-Header gap

A pet-hate of mine is the blank space above the first post, which looks strange unless you put something else in to the space.  In this example, I've got an AdSense link-unit in the area highlighted in red, just to fill in the empty area:



How to change this

1  Edit your template  - don't forget to take a backup.


2  Find this code  (use the text-find feature in your browser, eg ctrl/f in Chrome to make finding it easier)
h3.post-title, .comments h4 {
  font: $(post.title.font);
  margin: .75em 0 0;
}
The exact numbers used in your template may be different:  the key thing is to find the CSS command that is putting a margin above the post header.  In the template that I took this example from (Simple), it's the "0.75em" - which puts 75% of the space of a the post-header characters as a blank space above the header.


3   Change the first margin value:  how much to change it by depends on your template, but in some cases I've used 0 successfully.

In CSS, when a margin statement has three numbers beside it, they refer to the

  • top, 
  • left-and-right, 
  • bottom 

margins respectively.   So if you want to do something else to the post-header, eg indent it, this is the place to make changes


4   Click Preview to see what the blog will look like - keep doing this until you get the right setting.


5   When you are happy with the spacing, click Save Template to apply the changes to your blog.   (Or Clear Edits if you cannot get it right and need to stop trying).


Note:  If you make a big change to your template like this, it would be a good idea to check out out in at least one version of the other browsers that your readers use - at the moment, this usually means Internet Explorer 8, Firefox and Chrome.   But it may depend on your niche - a tool like Google Analytics will give you some statistics about what browsers, and screen sizes, your visitors have.

Also, it is possible to make this change by just installing a new CSS rule for h3.post-title into your blog - because the latest one found is always the one used, and because the template designer's Add CSS function puts the rules you add after the othr rules.   I don't recommend it here, though, because working with the original rule makes it easier to see the effect of making changes to any of the values in the area.


Other affected spacing

If you have more than one post per page, then this change will also reduce the amount of space between the bottom of one post and the header of the next one.   Depending on your template, you want want to add a little more space into the margin statement in the bottom of the post-footer, eg
.post-footer {
  margin: 20px -2px 20;
  padding: 5px 10px;
}

If you display comments in your blog, you also need to check the impact on comments, because the original command applied to h4 items in comments as well.

If you are making a lot of changes, you may want to make a test blog, and plan your changes in private before applying them to your main blog.



Related Articles:



Setting up Google Analytics to get statistics about for your visitors

Adding a new CSS rule to your blog's template

Advantanges and disadvantages of editing your template.

How to edit your blogger template

Who did your blogger template come from - the quick way of finding out

Making a test-blog for template changes

Planning changes to your blog in private

Installing code into your blog

This article is about how to install code into your blog.

Why you might want to install code:

Javascript Code example There are plenty of websites suggesting to tweak your blog.  A few these tell you how to use standard Blogger tools, but many have written code that does something useful that Blogger doesn't currently provide.

Also, there are lots of tutorials about how to do things with HTML, CSS or Javascript - no matter what "development environment" (Blogger, Dreamweaver, etc) you're working in.     For example, I recently wanted to put tables with scroll-bars into the posts of one site, and, after a bit of googling found a method that works across all the common browsers.  (Well it worked when I tested it first - sadly it wasn't working in Chrome when I finally finished loading the content, but that's another story!).

I'm generally wary about installing things from 3rd parties.  But there are times when it's a good thing to do because the benefits for your blog outweigh the risks - for example, I'm happy to install code from AdSense, Amazon Associates, Chitika, PayPal and various other well known brands.


How to install code:

Two previous articles describe how to install 3rd party HTML into your blog, and how to add CSS to your blog.

The only other type of code that you can add is Javascript.  To add this:

1  Edit your template, in the usual way.

2  Find the </head> statement

3  Put the code immediately before </head>, using this format:
<script type='text/javascript'>
//<![CDATA[

THE CODE GOES HERE


//]]>
</script>

4  Click the Preview button, to check that the blog loads and looks ok.

5  If it's not ok,choose Clear Edits and try again:  check you are putting the code in the right place.

6  Once you're happy, Save the changes.


Related Articles: 


Adding HTML into your blog,

Installing extra CSS rules into your blog.

Planning changes to your blog - in private

Showing Presentations in your blog

Is code from a 3rd party safe to install on my blog?   (coming soon)

Adding a separator line between your posts

This article shows how to put a horizontal separator line between posts in your blog, using either HTML's line command, or CSS rules.  It also has suggestions about ways of formatting these lines using different colours and line-styles.



There are at least four approaches to choose from if you want to put a divider between your posts in Blogger.  These days, I prefer the CSS-rule approach, because it's so easy and flexible.  But I've shown details of a few other methods too:
  • Manually add a horizontal line command to each post
  • Use the post-footer colour block as a line (in Designer templates only)
  • Add the HTML command for a line to the main section of your template, in one of the post-footers
  • Add a top or bottom-border to the CSS rule that formats the body of your posts.
The following sections give more detail about each option, including how to apply them to your blog, and their advantages and disadvantages.


Manually add a line to each post

When you are editing a post, you can put a horizontal line anywhere in the contents.

If Compose Settings (under Post Options) is set to  Interpret typed HTML, then you can just type <hr />, and Blogger will place a line like this in your post.


If your Compose Settings (under Post Options) is set to  Show HTML literally, then you need to switch to the Edit HTML tab before you type <hr />.

Disadvantage: If your post is set to display comments, or the blog is set to show the author, labels etc under the post, these items will be underneath any line that you add manually to a post.


Designer Template - post footer colour

If your blog has a designer template (ref, What sort of template have I got), then the Template Designer > Advanced tab may have an option for setting the background colour of the post-footer (depending on which template you are using).



If you use a dark colour (or have a dark background and use a light color), this makes the post-footer look like a line.

Disadvantage:  The "line" might be a bit thicker than you like.   And if your post is set to display comments, or the blog is set to show the author, labels etc under the post, these items are shown right inside the footer line.





Add a line-command to your template

If you don't like the other two approaches, you can change your template to add a horizontal line.  To do this:

1  Edit your template:

In Sept-2011-Blogger (ie the new interface) go to Template > Edit HTML > Proceed
In pre-Sept-2011-Blogger (ie the old interface) go to Design > Edit HTML.

Download a full copy of your template, and put it somewhere safe (in case things go wrong, and you need to go back to where you were).

3  Click on Expand Widget Templates.

4  Most templates have three footer lines:  what is in each one depends on the template, and how you have arranged the items in the Layout > Blog Posts editor.

Look at the template for code like the following,
       <div class='post-footer-line post-footer-line-2'><span class='post-labels'>
        <b:if cond='data:post.labels'>
          <data:postLabelsLabel/>
          <b:loop values='data:post.labels' var='label'>
            <a expr:href='data:label.url' rel='tag'><data:label.name/></a><b:if cond='data:label.isLast != &quot;true&quot;'>,</b:if>
          </b:loop>
        </b:if>
      </span> </div>
OR
 <div class='post-footer-line post-footer-line-3'/>
    </div>

and add the <hr /> command to which ever one you want, for example
 <div class='post-footer-line post-footer-line-3'/>
<hr />

    </div>

Advantage:  you can easily place the divider line anywhere you want it, relative to the other items in your post-footer.


Disadvantage:  you need to modify your template, and this does have some risks.  And it does use the <hr /> tag which some people (CSS purists) suggest is not a good idea.



Enhancements to the basic <hr /> command:


There are lots of ways you can modify the <hr / > code.   For example

<hr style="text-align: left;" /> -  to left-align it

<hr style="color: red;" /> -  to change the colour
<hr style="width: 50%;" /> -  to make it narrower

See w3c.schools <hr /> tag for more information. 



Add a border to the CSS rule that formats your posts

The cascading-style-sheet rules in your template control most aspects of how your blog looks.   They can be a very powerful way to control how your blog looks.

Quick option:

If you have a designer template, then the quick way to make this change is to add a CSS rule to your template.  The rule code to add is:
.post-body
{
border-bottom:1px dotted #666666;
}

or this one if you want the border at the top of each post:
.post-body
{
border-top:1px dotted #666666;
}

In-depth

The specific CSS rule that controls how the "body" of your posts look is .post-body.   To make changes to it:

1 Go to Design > Edit HTML

2 Download a full copy of your template, and put it somewhere safe (in case things go wrong, and you need to go back to where you were).

3 Look for .post-body in the rules section of your template. It will look something like this, but  the exact lines and values may be different:
.post-body {
margin-top: 0;
margin-$endSide: 2px;
margin-bottom: 0;
margin-$startSide: 3px;
}
 4  If you can find a .post-body rule, then add this line, just before the } character.
border-bottom:1px dotted #666666;
5    If you cannot find a  .post-body statement in the rules section of your template, then you need to add it.

Put it somewhere:
After    <b:skin><![CDATA[/*

Before  ]]></b:skin>

But not in the middle of any other rules: look at how the rest of that section of your template is laid out for clues.

The statement to add is something like the following, though you may want to try out different values for parts of it.:
.post-body {
border-bottom:1px dotted #666666;
margin-top: 0;
margin-$endSide: 2px;
margin-bottom: 0;
margin-$startSide: 3px;
padding-top:10px;
margin-top:20px;
}


Alternative formats:

The #666666 means draw the line in black - you may like to use a different colour, or use the word "solid" instead of "dotted" to make a firmer looking line.

As an alternative, you can say border-top:1px dotted #666666; - this puts a line at the top of the body of each post, just underneath the title.



Related Articles:


What sort of template have I got

Disadvantages of editing your blog's template.

Adding a new CSS rules to your template

Centering the Post-title or Page-title

Putting HTML from elsewhere into your blog.

Showing readers your blog in the new Dynamic View templates

It's easy to let readers see your blog using the new dynamic views / templates.  But there are some consequences.

What are the dynamic templates?

Template Flowers2In April 2011, Blogger announced:
" ... five new dynamic templates ... that you’ll soon be able to customize and use for your blog."

The post below is what I wrote then.    Some of the information is now out of date - for example you can now add a limited range of gadgets to dynamic-view templates, and you can choose them as a default.   You have control over colours etc the same as normal templates.    And Yoga on Southern Speakers has published a lot of ways you can use CSS rules to tweak dynamic templates.

But I am keeping the original content below, because the linking technique is useful for people who don't want to have a dynamic template all the time.



Original Post content:

I'll write more about what these are/aren't later on.   But for now, people want to know how to use them.

Applying the dynamic views to your blog:

Right now, there is no way to make any of the new dynamic templates the default opening view for your blog:  your blog still opens to the home page that you used, which in most cases shows the entire contents of your post recent post.

This may change, as Google works out how people want to use Blogger.   But in the meantime you can, very easily, give your readers a way to switch into any of the default views.

In short, just put some text that links to  
http://www.YOUR-BLOGS-URL/view 
into a place that your visitor can click on - and of course make sure that your blog meets the other conditions (ie public, feeds enabled, views not disabled) .

To give your readers more options, you could have five different links, similar to what I've done here:

In this option the links are to:
Flipcard http://www.YOUR-BLOGS-URL/view/flipcard
Mosaic http://www.YOUR-BLOGS-URL/view/mosaic
Sidebar http://www.YOUR-BLOGS-URL/view/sidebar
Snapshot http://www.YOUR-BLOGS-URL/view/snapshot
Timeslide http://www.YOUR-BLOGS-URL/view/timeslide

I've done fancy things to format the links as buttons (will explain how to do that in another article).  But there are lots of possibilities:  you could just make the links plain text in a row, or even put them into a link-list gadget.

Consequences:

If you let people look at your blog in a dynamic view, there are restrictions that they will face. These may not be a problem, depending on your niche and how important a customized-look-and-feel and right-up-to-date news is for your audience.  But you do need to think about:

Displays and Monetization:
Initially, you cannot customise the way that the dynamic template look at all:
  • Fonts, colours, item placement - everything is based on the standard template
  • None of the widget that are on you blog are included
  • None of your "static" pages are shown
  • None of your advertisements are shown:  this includes AdSense ads that are embedded right inside blog-posts.
  • Some of the view templates are very visual:  the reader is shown a page of pictures, and each page represents one post.   Currently you don't have ANY control over which picture Blogger uses to represent your posts on these displays.

Search Results
Most (all?) of the dynamic templates have a search-function built into them, and some let you search by Label or Post-date too.

However Blogger have said that the search-results are limited to posts that are shown on the screen at the time the search is done.   So if a viewer has a slow connection, or is impatient, the search will not include a lot of your posts.

Even if your readers have a fast connection, I'm pretty sure that the search only looks at posts that are currently in your RSS "feed".   The last time I looked, this was limited to 512kb (or was it 524kB) - something like that).  If your blog's feed is set to "full" and you have some large pictures in your blog, this may mean that only a small proportion of your overall posts are available to be searched.
 .
Internal navigation:
When you're looking at a blog in a dynamic template, clicking on any post-title takes you to a view of that post in the current dynamic template.   But clicking on an in-post link to another post title (eg a link like how to display a powerpoint presentation inside your blog as a slideshow) opens the post in a new window using the "standard" template that you have set up for your blog.

Statistics:
Currently, most statistics-gathering tools (eg Google Analytics) are put onto your blog either by changing the blog-template, or by installing some code into a widget.   Either way, the statistics tool code will not run, so you will not get any statistics about people who view your blog using the new templates.

(NB  I haven't tested this, but I'm 99% certain that it's correct).

Other consequences:
Dynamic template are a brand new feature.   There will be issues that I haven't considered yet.   I'd love to hear your thoughts about the templates and the challenges that we face in adapting to this new way that Blogger may start working.


Related Articles: 



Introducing Dynamic Views in Blogger

Showing a PowerPoint presentation as a slide-show inside your blog

Choosng the colours in your blog,

Putting AdSense ads right inside your blog-posts.

Setting the home page on your blog

Google Analytics and your blog

Removing the Attribution gadget from blogs that have Designer Templates

This article is about how to change or delete the attribution that Google has added to add blogs which have a Designer template.    (Updated May 2011 with the latest status of the methods listed.)

What is the attribution - and what's wrong with it.

picture of Powered by Blogger being painted over, with a purple picture frame border
If your blog has a Designer template (ref What sort of template do I have?) you may have noticed a gadget in the blog-footer called attribution.   This gives credit to:
  • The template designer
    (Even though s/he only designed the structure, not the colour, font and gadget layout combination that you're using - and readers who aren't familiar with Blogger probably won't understand the distinction between your work and the template-programmer)
  • The copyright owner of the background photo you're using
    (Even though s/he doesn't own any of the zillion other photos in your blog - and again, readers aren't going to understand what photographs are part of the template and what aren't)
  • Blogger for "powering" your blog
    (Even though they're hosting it, and the real power may be provided by other tools:  eg I have blogsites hosted by Blogger but whose real power comes from Google Maps, Google Custom Search, and Sites.)

The gadget also has a field "Copyright (optional)".  Whatever you put into this is shown at the beginning of the attribution.  It will accept some simple HTML commands, for example a line break (<br />) as shown in the picture.   But I have a feeling that adding something more complex, eg an entire Creative Commons statement, won't work.



How to remove the Attribution Gadget

Removing this gadget has been troublesome since it was introduced.   Several times, we found a method to remove it, which worked for a while.   But then Blogger added a check for that method, and code to put the gadget back again each time the template was saved - so we had to find another approach..

For a while they stopped putting the gadget back and the earlier, simpler methods of removing the gadget were working.  Then they stopped again.   So the complete list of removal methods that I've found, with notes about their current status, is below.

WARNING:  

I have not checked the Blogger Terms and Conditions to find out whether you are allowed to remove the Attribution.   Even if they don't mention it today, a requirement to keep the statement could be added tomorrow.   This advice does not mean that I, or Google/Blogger, are saying that you should/can/may/must remove the attribution statement.


Methods that currently work:


Techniques that used to work, but don't any more:
  • Unlocking and removing the gadget
    This worked initially, then stopped.   Most recently (Jan 2011), it was working again.    If you try it, and it doesn't work, please leave a comment below, and try one of the other methods.


Advantages and Disadvantages:

I'm not keen on methods that involve hiding things, because it may make search-engines think you're being sneaky.

But changing the template-name may mean you don't get improvements that Google apply to the standard templates in future (eg support for new browser features, bug-fixes).

It may also mean that you get less-sympathetic responses to future question in the Blogger Help Forum:  when people use 3rd party templates, one regular reply to, "how do I do XXXX to my template"  is "ask your template provider."

To avoid this, you should at very least remember what template you were using, and possible even rename yours to something like "WHATEVER, based on Awesome".


Give credit where it's due: 

If you do remove the standard attribution gadget, it may be a good idea to replace it with a customised attribution that acknowledges any or all of your domain registrar, blog-host (Blogger, AKA Google), file host, template designer and customiser, graphic designer, content writer(s) - in short anyone whose efforts have contributed to your blog.


Related Articles: 



Giving your blog a customised attribution gadget

Adding a CSS rule to hide the attribution gadget

Changing your template name or designer-name

Removing attribution from mobile-template blogs

Deleting the attribution gadget by unlocking and removing it

Deleting the attribution gadget by commenting out the code.  

How the data in your Blogger blog is organised